UI design question

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:UI design question

Post by Candy »

The idea was more about the network-stream or the audio-stream or the keyboard-input-stream... When outputting audio, you'd want an echo effect, I'd like the code to be something like:

Code: Select all

stream::effect<audio> echo = system::getStreamEffect("audio:44100/6/16", "echo");
module <file, audio> mp3loader = system::getModule("file:mp3", "audio:44100/6/16");
module <audio, pausablestream> audiostreamer = system::getModule("audio:44100/6/16", "??? - something like a pausable audio stream");

stream audio = audiostreamer(mp3loader(new file("/mp3z/track01.mp3")));
stream echoedaudio = echo(audio);
module <audio, sound> play = system::getModule("audio:44100/6/16", "sound");

play(audio);

but as you can see this is far from nice, and I even had to leave a gap because I can't think of a way to do that :(...
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:UI design question

Post by Pype.Clicker »

hmm. So actually you have

Code: Select all

<filter family="audio" name="echo">
     <input allow="audio/raw">
          <encoding freq="system.audio.known-freq.*"/>
     </input>
     <output produce="audio/raw"><norecode/></output>
</filter>
<filter family="audio" name="codec">
     <input allow="audio/mp3"/>
     <output produce="audio/raw">
         <encoding freq="system.audio.known-freq.*"/>
     </output>
</filter>
coming with the "echo" and "MP3decoder" modules ...

I'd then say that you create a 'direct' playback with

Code: Select all

Speakers=System.locate(family="audio", name="output");
Codec=System.locate(family="audio", name="codec",   
                               input=myFile.getAudioDescriptor(), 
                               output=Speakers.getAudioDescriptor());

Codec.setInput(myFile);      // connects myFile --> codec
Speakers.setInput(Codec);  // connects codec  --> speakers
And if you want to add an echo module

Code: Select all

Speakers=System.locate(family="audio", name="output");
Source = Speakers.getInput();
Echo = System.locate(family="audio", name="echo",
                                input=Source.getAudioDescriptor(),
                                output=Speakers.getAudioDescriptor());
Echo.setArg(parameter="delay", value="0.05ms");
Echo.setInput(Source);   // disconnects codec -- speakers and
                                  //  replace with codec -- echo
Speakers.setInput(Echo);
nice enough ?
Post Reply