#include <DeviceOSS.h>
Inheritance diagram for OSSDevice:

Public Member Functions | |
| OSSDevice () | |
| Constructor. | |
| virtual | ~OSSDevice () |
| Destructor. | |
| virtual const wxString & | Name () const |
| Get the name of the device. | |
| virtual bool | Init (const format_ex_t &fmt, DeviceCallback &callback) |
| Open the device. | |
| virtual void | Play () |
| Start playback. | |
| virtual void | Pause () |
| Pause playback. | |
| virtual void | Done () |
| Close the device. | |
| virtual samples_t | GetPosition () |
| Get current position. | |
| virtual void | Configure (wxWindow *parent) |
| Open configure dialog. | |
Static Public Member Functions | |
| Device * | RegisterDevice () |
| Create device object instance. | |
Private Member Functions | |
| void | done () |
| Cleanup. | |
Private Attributes | |
| DeviceCallback * | cb |
| Data callback. | |
| format_ex_t | pfmt |
| Playback format. | |
| pthread_t | play |
| Playback thread. | |
| pthread_t | push |
| Push thread. | |
| wxString | pdev_name |
| Device node filename. | |
| int | pdev |
| Device node file descriptor. | |
| bool | opened |
| Opened flag. | |
| bool | playing |
| Playing flag. | |
| int | initstate |
| sem_t | play_sem |
| Playback semaphore. | |
| sem_t | push_sem |
| Push semaphore. | |
| pthread_mutex_t | buf_mutex |
| Shared structures mutex. | |
| size_t | buf_count |
| Number of cyclic buffer blocks. | |
| size_t | buf_len |
| Cyclic buffer length (bytes). | |
| size_t | buf_start |
| Starting data offset of the cyclic buffer. | |
| size_t | buf_size |
| Size of data in the cyclic buffer. | |
| size_t | latency |
| Cyclic buffer block size. | |
| void * | buf |
| Cyclic buffer. | |
| samples_t | position |
| Buffer position. | |
| samples_t | rpos |
| Real-time (playback) position. | |
| int | oldpos |
| Previous real-time position by SNDCTL_DSP_GETOPTR. | |
Friends | |
| void * | play_thread (void *data) |
| Playback thread code. | |
| void * | push_thread (void *data) |
| Push thread code. | |
Device for accessing Open Sound System devices (usually /dev/dsp). Linux/unix specific.
Uses pthreads.
|
|
Constructor. Create OSS device. |
|
|
Destructor. Cleanup. |
|
|
Open configure dialog.
Implements Device. |
|
|
Cleanup. Stop playback (if playing), close the wave device, dispose threads and buffers, cleanup. |
|
|
Close the device. Stop playback, close device and do cleanup. Implements Device. |
|
|
Get current position. Get the index of the sample currently playing. The accuracy depends on the low-level driver capabilities.
Implements Device. |
|
||||||||||||
|
Open the device. Prepare the device for playback.
Implements Device. |
|
|
Get the name of the device.
Implements Device. |
|
|
Pause playback. Pause (or resume paused) playback. Implements Device. |
|
|
Start playback. Start the playback of an initialized device. Implements Device. |
|
|
Create device object instance.
|
|
|
Playback thread code. This thread plays the head of the cyclic buffer with the wave device.
|
|
|
Push thread code. This thread uses the supplied callback function to generate wave data and push it to the cyclic buffer.
|
|
|
Cyclic buffer.
|
|
|
Number of cyclic buffer blocks.
|
|
|
Cyclic buffer length (bytes).
|
|
|
Shared structures mutex.
|
|
|
Size of data in the cyclic buffer.
|
|
|
Starting data offset of the cyclic buffer.
|
|
|
Data callback.
|
|
|
|
|
|
Cyclic buffer block size.
|
|
|
Previous real-time position by SNDCTL_DSP_GETOPTR.
|
|
|
Opened flag.
|
|
|
Device node file descriptor.
|
|
|
Device node filename.
|
|
|
Playback format.
|
|
|
Playback thread.
|
|
|
Playback semaphore.
|
|
|
Playing flag.
|
|
|
Buffer position.
|
|
|
Push thread.
|
|
|
Push semaphore.
|
|
|
Real-time (playback) position.
|
1.3.5