- -( dyne // software :: culture :: events :: planet :: discussion :: museum \\ freaknet )- -
 
Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members

Stream_mixer Class Reference

#include <jmixer.h>

Collaboration diagram for Stream_mixer:

Collaboration graph
[legend]
List of all members.

Detailed Description

the Multiple Streaming Engine class

Everything is connected to Stream_mixer: the instance of this class controls all existent input and output channels attached to it, plus it holds the file descriptors for the soundcard and all the necessary private buffers of MuSE.

The Stream_mixer runs thru the cafudda() function which should be always called from the main (parent) thread of your program.

Child threads are spawned by some of the public functions offered by this class, anyway you don't have to take care of those issues.

Definition at line 63 of file jmixer.h.

Public Member Functions

 Stream_mixer ()
 the Stream_mixer class constructor

 ~Stream_mixer ()
 the Stream_mixer class destructor

bool create_channel (int ch)
 create channel ch

bool delete_channel (int ch)
 deletes the channel ch

bool add_to_playlist (int ch, const char *file)
 inserts a new entry at the bottom of a channel playlist

void rem_from_playlist (int ch, int pos)
 removes the entry at a certain position from a channel playlist

bool set_channel (int ch, int playlist_pos)
 selects the entry at a certain position of a channel playlist

int play_channel (int ch)
 set the channel playing

bool stop_channel (int ch)
 stop the channel

bool pause_channel (int ch)
 switch channel pause state between true and false

bool pause_channel (int ch, bool stat)
 set the channel pause state

bool set_volume (int ch, float vol)
 set a channel volume

void set_all_volumes (float *vol)
 set all channel volumes at once

void crossfade (int ch1, float vol1, int ch2, float vol2)
 set the volumes of two channels at once

bool set_playmode (int ch, int mode)
 set the playmode of a channel (LOOP,CONT,PLAY)

void set_speed (int ch, int speed)
 this is VERY EXPERIMENTAL, but we might get there soon

bool set_position (int ch, float pos)
 set the channel position (from 0.0 to 1.0)

bool move_song (int ch, int pos, int nch, int npos)
 move a playlist entry of a channel from a position to the other

bool set_live (bool stat)
 set the state of the live input from soundcard

void set_mic_volume (int vol)
 set the volume of the mic live input (sample multiplyer)

bool set_lineout (bool stat)
 set the state of the live output to soundcard

int create_enc (enum codec enc)
 Create a new OutChannel encoder channel.

void delete_enc (int id)
 Delete an OutChannel encoder (discards ID).

OutChannelget_enc (int id)
 Returns the OutChannel instance with the given ID.

bool apply_enc (int id)
 apply the current OutChannel configuration

void register_gui (GUI *reg_gui)
 tell the mixer there is an GUI

bool open_soundcard (bool in, bool out)
void close_soundcard ()
 SoundDevice class for soundcard handling.

void cafudda ()
 THIS IS THE MAIN MIXING PROCEDURE: CAFUDDA!

bool dsp_ok ()
 notice if we have a soundcard

void cli_vumeter_set (int val)
 so this is as well experimental


Public Attributes

SoundDevicesnddev
Channelchan [MAX_CHANNELS]
IN_DATATYPE linein_buf [PROCBUF_SIZE]
int linein_samples
int linein_vol
LiveIn livein
Linklist outchans
OutChannellame
OutChannelogg
bool cli_vumeter
 commandline vumeter is experimental

bool dspout
 is there output to the soundcard speakers?

bool linein
 is there some input from the microphone?

bool fileout
 is there a file dumping? (redundant!)

bool quit
 should we keep on running?


Constructor & Destructor Documentation

Stream_mixer::Stream_mixer  ) 
 

the Stream_mixer class constructor

Definition at line 76 of file jmixer.cpp.

Stream_mixer::~Stream_mixer  ) 
 

the Stream_mixer class destructor

Definition at line 118 of file jmixer.cpp.


Member Function Documentation

void Stream_mixer::cafudda  ) 
 

THIS IS THE MAIN MIXING PROCEDURE: CAFUDDA!

Cafudda should be repeatedly called by the main process. It doesn't fills up the CPU load so there is no need to wait or do any time syncronizing, it is just all done inside.

Call it repeatedly after launching all the GUI threads and setting up the engine to act as you like, then while running on the main process the mixer can still be used by interface threads.

see main.cpp for an example of its use.

Definition at line 169 of file jmixer.cpp.

void Stream_mixer::cli_vumeter_set int  val  ) 
 

so this is as well experimental

void Stream_mixer::close_soundcard  ) 
 

SoundDevice class for soundcard handling.

Definition at line 165 of file jmixer.cpp.

bool Stream_mixer::dsp_ok  )  [inline]
 

notice if we have a soundcard

Returns:
true if one was found

Definition at line 296 of file jmixer.h.

bool Stream_mixer::open_soundcard bool  in,
bool  out
 

Definition at line 158 of file jmixer.cpp.

void Stream_mixer::register_gui GUI reg_gui  ) 
 

tell the mixer there is an GUI

Used to register a GUI instance to a Stream_mixer

An example of using it is inside muse.cpp main()

Parameters:
reg_gui GUI instance to register (see gui.h)

Definition at line 150 of file jmixer.cpp.


Member Data Documentation

Channel* Stream_mixer::chan[MAX_CHANNELS]
 

Array of Channels

Definition at line 300 of file jmixer.h.

bool Stream_mixer::cli_vumeter
 

commandline vumeter is experimental

Definition at line 320 of file jmixer.h.

bool Stream_mixer::dspout
 

is there output to the soundcard speakers?

Definition at line 323 of file jmixer.h.

bool Stream_mixer::fileout
 

is there a file dumping? (redundant!)

Definition at line 325 of file jmixer.h.

OutChannel* Stream_mixer::lame
 

Definition at line 316 of file jmixer.h.

bool Stream_mixer::linein
 

is there some input from the microphone?

Definition at line 324 of file jmixer.h.

IN_DATATYPE Stream_mixer::linein_buf[PROCBUF_SIZE]
 

live soundcard input

Definition at line 303 of file jmixer.h.

int Stream_mixer::linein_samples
 

Definition at line 304 of file jmixer.h.

int Stream_mixer::linein_vol
 

Definition at line 305 of file jmixer.h.

LiveIn Stream_mixer::livein
 

Definition at line 307 of file jmixer.h.

OutChannel* Stream_mixer::ogg
 

Definition at line 317 of file jmixer.h.

Linklist Stream_mixer::outchans
 

encoder outchannels

Definition at line 310 of file jmixer.h.

bool Stream_mixer::quit
 

should we keep on running?

Definition at line 326 of file jmixer.h.

SoundDevice* Stream_mixer::snddev
 

Definition at line 269 of file jmixer.h.


The documentation for this class was generated from the following files: