Search Results

Search found 18 results on 1 pages for 'me2'.

Page 1/1 | 1 

  • How to play multiple audio sources simultaneously in Silverlight

    - by Shurup
    I want to play simultaneous multiply audio sources in Silverlight. So I've created a prototype in Silverlight 4 that should play a two mp3 files containing the same ticks sound with an intervall 1 second. So these files must be sounded as one sound if they will be played together with any whole second offsets (0 and 1, 0 and 2, 1 and 1 seconds, etc.) I my prototype I use two MediaElement (me and me2) objects. DateTime startTime; private void Play_Clicked(object sender, RoutedEventArgs e) { me.SetSource(new FileStream(file1), FileMode.Open))); me2.SetSource(new FileStream(file2), FileMode.Open))); var timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(1) }; timer.Tick += RefreshData; timer.Start(); } First file should be played at 00:00 sec. and the second in 00:02 second. void RefreshData(object sender, EventArgs e) { if(me.CurrentState != MediaElementState.Playing) { startTime = DateTime.Now; me.Play(); return; } var elapsed = DateTime.Now - startTime; if(me2.CurrentState != MediaElementState.Playing && elapsed >= TimeSpan.FromSeconds(2)) { me2.Play(); ((DispatcherTimer)sender).Stop(); } } The tracks played every time different and not simultaneous as they should (as one sound). Addition: I've tested a code from the Bobby's answer. private void Play_Clicked(object sender, RoutedEventArgs e) { me.SetSource(new FileStream(file1), FileMode.Open))); me2.SetSource(new FileStream(file2), FileMode.Open))); // This code plays well enough. // me.Play(); // me2.Play(); // But adding the 2 second offset using the timer, // they play no simultaneous. var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(2) }; timer.Tick += (source, arg) => { me2.Play(); ((DispatcherTimer)source).Stop(); }; timer.Start(); } Is it possible to play them together using only one MediaElement or any implementation of MediaStreamSource that can play multiply sources?

    Read the article

  • multiple droppable

    - by Sune
    Ive have multiple droppable divs (which all have the same size) and one draggable div. The draggable div is 3 times bigger than one droppable. When I drag the draggable div on the droppables divs I want to find which droppable has been affeckted. My code looks like this: $(function () { $(".draggable").draggable({ drag: function (event, ui) { } }); $(".droppable").droppable({ drop: function (event, ui) { alert(this.id); } }); }); the html <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div0" class="droppable"> drop in me1! </div> <div style="height:100px; width:200px; border-bottom:1px solid red;" id="Div1" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div2" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div3" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div4" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div5" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div6" class="droppable"> drop in me2! </div> <div style="height:100px; width:200px; border-bottom:1px solid red; " id="Div7" class="droppable"> drop in me2! </div> <div class="draggable" id="drag" style="height:300px; width:50px; border:1px solid black;"><span>Drag</span></div> But my alert only shows the first which my draggable div (Div0) hits, how can I find the missing (Div1 and Div2), which also is affeckted?? Here's a guy with the same problem : http://forum.jquery.com/topic/drop-onto-multiple-droppable-elements-at-once

    Read the article

  • How to play simultaneous multiply audio sources in Silverlight

    - by Shurup
    I want to play simultaneous multiply audio sources in Silverlight. So I've created a prototype in Silverlight 4 that should play a two mp3 files containing the same ticks sound with an intervall 1 second. So these files must be sounded as one sound if they will be played together with any whole second offsets (0 and 1, 0 and 2, 1 and 1 seconds, etc.) I my prototype I use two MediaElement (me and me2) objects. DateTime startTime; private void Play_Clicked(object sender, RoutedEventArgs e) { me.SetSource(new FileStream(file1), FileMode.Open))); me2.SetSource(new FileStream(file2), FileMode.Open))); var timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(1) }; timer.Tick += RefreshData; timer.Start(); } First file should be played at 00:00 sec. and the second in 00:02 second. void RefreshData(object sender, EventArgs e) { if(me.CurrentState != MediaElementState.Playing) { startTime = DateTime.Now; me.Play(); return; } var elapsed = DateTime.Now - startTime; if(me2.CurrentState != MediaElementState.Playing && elapsed >= TimeSpan.FromSeconds(2)) { me2.Play(); ((DispatcherTimer)sender).Stop(); } } The tracks played every time different and not simultaneous as they should (as one sound).

    Read the article

  • Is there an way to get the top level classes included in a puppet node?

    - by pwan
    Is there an easy way to return the top level classes applied to a node. By this I mean the classes included in a node definition or ENC equivalent For example with the sample node below, I'd like to return 'return::me' and 'return::me2' for somehost, but not 'dontreturn::me' class return::me { include dontreturn::me } node "somehost" { include return::me include return::me2 } I see that /var/lib/puppet/state/classes.txt includes the full list of classes applied to the node, but that includes any additional classes included by to the top level classes. Is there some way to get at this data with a puppet faces command ? I suspect 'puppet nodes' might be useful, but I haven't been able to get it return what I what.

    Read the article

  • Mac sees mangled filenames from Linux SAMBA share

    - by me2
    Certain filenames in my SAMBA shares from Linux are not getting transmitted properly. It's certain files in certain folders and it doesn't affect all folders or all files within a single folder. I can find no discerning pattern to the mangling but hoping that this is a known problem. No amount of reboot, restart, etc. will fix this problem. The filenames, when they get mangled, all end up in this form: 0JY4B3~H.M4V 0MBS1O~M.M4V 0NKDX9~R.M4V 0O0ZTA~A.M4V These are MPEG4 files. The extension remains intact. Any ideas?

    Read the article

  • Using Haskell's Parsec to parse binary files?

    - by me2
    Parsec is designed to parse textual information, but it occurs to me that Parsec could also be suitable to do binary file format parsing for complex formats that involve conditional segments, out-of-order segments, etc. Is there an ability to do this or a similar, alternative package that does this? If not, what is the best way in Haskell to parse binary file formats?

    Read the article

  • In Haskell, will calling length on a Lazy ByteString force the entire string into memory?

    - by me2
    I am reading a large data stream using lazy bytestrings, and want to know if at least X more bytes is available while parsing it. That is, I want to know if the bytestring is at least X bytes long. Will calling length on it result in the entire stream getting loaded, hence defeating the purpose of using the lazy bytestring? If yes, then the followup would be: How to tell if it has at least X bytes without loading the entire stream? EDIT: Originally I asked in the context of reading files but understand that there are better ways to determine filesize. Te ultimate solution I need however should not depend on the lazy bytestring source.

    Read the article

  • Parsing JPEG file format: Format of entropy-coded segment (ECS) segments?

    - by me2
    I'm having difficulty understanding the ITU-T T.81 spec for the JPEG file format. Hopefully someone else here has tried to parse JPEG files and/or knows about the details of this file format. The spec indiates that the ECS0 segment starts after the SOS segment but I can't find where in the spec it actually talks about the format of the ECS0 segment or how do detect its start. Simple JPEG implementations online are of limited help because they assume many things about the JPEGs they parse. Can anyone point me in the right direction?

    Read the article

  • "Subclassing" show in Haskell?

    - by me2
    Lets say I have the following: data Greek = Alpha | Beta | Gamma | Phi deriving Show I want to use the default showing of all items except Beta, which I want to say "two". Can I do this?

    Read the article

  • Parsing JPEG file format: Format of entropy-coded segments (ECS) ?

    - by me2
    I'm having difficulty understanding the ITU-T T.81 spec for the JPEG file format. Hopefully someone else here has tried to parse JPEG files and/or knows about the details of this file format. The spec indiates that the ECS0 segment starts after the SOS segment but I can't find where in the spec it actually talks about the format of the ECS0 segment or how do detect its start. Simple JPEG implementations online are of limited help because they assume many things about the JPEGs they parse. Can anyone point me in the right direction? FYI: The JPEG file format spec is here.

    Read the article

  • Examples of attoparsec in parsing binary file formats?

    - by me2
    Previously attoparsec was suggested to me for parsing complex binary file formats. While I can find examples of attoparsec parsing HTTP, which is essentially text based, I cannot find an example parsing actual binary, for example, a TCP packet, or image file, or mp3. Can someone post some code or pointer to some code which does this using attoparsec?

    Read the article

  • Example of use of unregistered, dynamically created gen_server's?

    - by me2
    Tutorials are abound for working with gen_servers that are named in an OTP application. However, I've been unable to find a good example of dynamically spawning servers that are not registered (not named). Can someone point to a good, simple example? Not ejabberd, for example, where there is a lot to confuse the core idea I'm trying to get at. Thanks.

    Read the article

  • Haskell optimization of a function looking for a bytestring terminator

    - by me2
    Profiling of some code showed that about 65% of the time I was inside the following code. What it does is use the Data.Binary.Get monad to walk through a bytestring looking for the terminator. If it detects 0xff, it checks if the next byte is 0x00. If it is, it drops the 0x00 and continues. If it is not 0x00, then it drops both bytes and the resulting list of bytes is converted to a bytestring and returned. Any obvious ways to optimize this? I can't see it. parseECS = f [] False where f acc ff = do b <- getWord8 if ff then if b == 0x00 then f (0xff:acc) False else return $ L.pack (reverse acc) else if b == 0xff then f acc True else f (b:acc) False

    Read the article

  • Haskell optimization of the following function

    - by me2
    Profiling of some code of mine showed that about 65% of the time I was running the following code. What it does is use the Data.Binary.Get monad to walk through a bytestring looking for the terminator. If it detects 0xff, it checks if the next byte is 0x00. If it is, it drops the 0x00 and continues. If it is not 0x00, then it drops both bytes and the resulting list of bytes is converted to a bytestring and returned. Any obvious ways to optimize this code? I can't see it. parseECS = f [] False where f acc ff = do b <- getWord8 if ff then if b == 0x00 then f (0xff:acc) False else return $ L.pack (reverse acc) else if b == 0xff then f acc True else f (b:acc) False

    Read the article

  • VIM equivalent for (something like) 6xi?

    - by me2
    There's a command in VIM where you can say how many chars to replace, and VIM will put a "$" at that many characters out, and you can type in the replacement for those characters. The original and new text can be different lengths. What's the command for this?

    Read the article

1