Update of /cvsroot/playerstage/code/player/server/drivers/audio
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30199/server/drivers/audio

Modified Files:
        alsa.cc alsa.h 
Log Message:
overhaul of the player interface definitions
interfaces are now defined with a very light weight IDL allowing them to be 
edited in a single file
some subtype names were also modified as a side effect, making them more 
consistent globally


Index: alsa.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/audio/alsa.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** alsa.h      12 Feb 2007 01:30:13 -0000      1.7
--- alsa.h      20 Aug 2007 06:37:26 -0000      1.8
***************
*** 26,30 ****
  
  
////////////////////////////////////////////////////////////////////////////////
! // Describes a prestored sample for playing with PLAYER_AUDIO_SAMPLE_PLAY_CMD
  typedef struct StoredSample
  {
--- 26,30 ----
  
  
////////////////////////////////////////////////////////////////////////////////
! // Describes a prestored sample for playing with PLAYER_AUDIO_CMD_SAMPLE_PLAY
  typedef struct StoredSample
  {

Index: alsa.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/audio/alsa.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** alsa.cc     29 Apr 2007 00:19:24 -0000      1.10
--- alsa.cc     20 Aug 2007 06:37:26 -0000      1.11
***************
*** 36,48 ****
  Not all of the audio interface is supported. Currently supported features are:
  
! PLAYER_AUDIO_WAV_PLAY_CMD - Play raw PCM wave data
! PLAYER_AUDIO_SAMPLE_PLAY_CMD - Play locally stored and remotely provided 
samples
! PLAYER_AUDIO_WAV_STREAM_REC_CMD - Toggle streamed-to-client recording
! PLAYER_AUDIO_MIXER_CHANNEL_CMD - Change volume levels
! PLAYER_AUDIO_MIXER_CHANNEL_LIST_REQ - Get channel details
! PLAYER_AUDIO_MIXER_CHANNEL_LEVEL_REQ - Get volume levels
! PLAYER_AUDIO_SAMPLE_LOAD_REQ - Store samples provided by remote clients (max 
1MB)
! PLAYER_AUDIO_SAMPLE_RETRIEVE_REQ - Send stored samples to remote clients (max 
1MB)
! PLAYER_AUDIO_SAMPLE_REC_REQ - Record new samples directly on the server
  
  Known bugs:
--- 36,48 ----
  Not all of the audio interface is supported. Currently supported features are:
  
! PLAYER_AUDIO_CMD_WAV_PLAY - Play raw PCM wave data
! PLAYER_AUDIO_CMD_SAMPLE_PLAY - Play locally stored and remotely provided 
samples
! PLAYER_AUDIO_CMD_WAV_STREAM_REC - Toggle streamed-to-client recording
! PLAYER_AUDIO_CMD_MIXER_CHANNEL - Change volume levels
! PLAYER_AUDIO_REQ_MIXER_CHANNEL_LIST - Get channel details
! PLAYER_AUDIO_REQ_MIXER_CHANNEL_LEVEL - Get volume levels
! PLAYER_AUDIO_REQ_SAMPLE_LOAD - Store samples provided by remote clients (max 
1MB)
! PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE - Send stored samples to remote clients (max 
1MB)
! PLAYER_AUDIO_REQ_SAMPLE_REC - Record new samples directly on the server
  
  Known bugs:
***************
*** 53,57 ****
  
  Locally stored samples are preferred to samples loaded over the network or 
using
! the PLAYER_AUDIO_WAV_PLAY_CMD message for a number of reasons:
  
  - It takes time to transfer large quantities of wave data over the network.
--- 53,57 ----
  
  Locally stored samples are preferred to samples loaded over the network or 
using
! the PLAYER_AUDIO_CMD_WAV_PLAY message for a number of reasons:
  
  - It takes time to transfer large quantities of wave data over the network.
***************
*** 67,75 ****
  meaning local samples will only be limited by disc space to store them.
  
! When retrieving samples from the server via the 
PLAYER_AUDIO_SAMPLE_RETRIEVE_REQ
  request, note that any sample with a data length greater than
  PLAYER_AUDIO_WAV_BUFFER_SIZE will be truncated to this size.
  
! When using the PLAYER_AUDIO_SAMPLE_LOAD_REQ and PLAYER_AUDIO_SAMPLE_REC_REQ
  messages to store samples, currently only appending and overwriting existing
  samples is allowed. Trying to store at a specific index greater than the 
number
--- 67,75 ----
  meaning local samples will only be limited by disc space to store them.
  
! When retrieving samples from the server via the 
PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE
  request, note that any sample with a data length greater than
  PLAYER_AUDIO_WAV_BUFFER_SIZE will be truncated to this size.
  
! When using the PLAYER_AUDIO_REQ_SAMPLE_LOAD and PLAYER_AUDIO_REQ_SAMPLE_REC
  messages to store samples, currently only appending and overwriting existing
  samples is allowed. Trying to store at a specific index greater than the 
number
***************
*** 113,118 ****
  - usequeue (boolean)
    - Default: true
!   - Turns the queuing system on/off. When true, all PLAYER_AUDIO_WAV_PLAY_CMD
!     and PLAYER_AUDIO_SAMPLE_PLAY_CMD commands will be added to a queue and
      played in order of request. When off, sending a new command will stop the
      currently playing sound and start the new one.
--- 113,118 ----
  - usequeue (boolean)
    - Default: true
!   - Turns the queuing system on/off. When true, all PLAYER_AUDIO_CMD_WAV_PLAY
!     and PLAYER_AUDIO_CMD_SAMPLE_PLAY commands will be added to a queue and
      played in order of request. When off, sending a new command will stop the
      currently playing sound and start the new one.
***************
*** 1266,1270 ****
  
                // Publish this packet
!               Publish (device_addr, NULL, PLAYER_MSGTYPE_DATA, 
PLAYER_AUDIO_WAV_REC_DATA, reinterpret_cast<void*> (&packet), sizeof 
(player_audio_wav_t), NULL);
                delete[] packet.data;
        }
--- 1266,1270 ----
  
                // Publish this packet
!               Publish (device_addr, NULL, PLAYER_MSGTYPE_DATA, 
PLAYER_AUDIO_DATA_WAV_REC, reinterpret_cast<void*> (&packet), sizeof 
(player_audio_wav_t), NULL);
                delete[] packet.data;
        }
***************
*** 1938,1942 ****
  
        MixerLevelsToPlayer (&data);
!       Publish (device_addr, NULL, PLAYER_MSGTYPE_DATA, 
PLAYER_AUDIO_MIXER_CHANNEL_DATA, reinterpret_cast<void*> (&data), sizeof 
(player_audio_mixer_channel_list_t), NULL);
  }
  
--- 1938,1942 ----
  
        MixerLevelsToPlayer (&data);
!       Publish (device_addr, NULL, PLAYER_MSGTYPE_DATA, 
PLAYER_AUDIO_DATA_MIXER_CHANNEL, reinterpret_cast<void*> (&data), sizeof 
(player_audio_mixer_channel_list_t), NULL);
  }
  
***************
*** 2339,2343 ****
  
  
! // Sends a PLAYER_AUDIO_STATE_DATA message describing the current state of 
the driver
  void Alsa::SendStateMessage (void)
  {
--- 2339,2343 ----
  
  
! // Sends a PLAYER_AUDIO_DATA_STATE message describing the current state of 
the driver
  void Alsa::SendStateMessage (void)
  {
***************
*** 2352,2356 ****
                msg.state = PLAYER_AUDIO_STATE_STOPPED;
  
!       Publish (device_addr, NULL, PLAYER_MSGTYPE_DATA, 
PLAYER_AUDIO_STATE_DATA, reinterpret_cast<void*> (&msg), sizeof 
(player_audio_state_t), NULL);
  }
  
--- 2352,2356 ----
                msg.state = PLAYER_AUDIO_STATE_STOPPED;
  
!       Publish (device_addr, NULL, PLAYER_MSGTYPE_DATA, 
PLAYER_AUDIO_DATA_STATE, reinterpret_cast<void*> (&msg), sizeof 
(player_audio_state_t), NULL);
  }
  
***************
*** 2475,2479 ****
                oldSample->sample = newSample;
        }
!       Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_SAMPLE_LOAD_REQ, NULL, 0, NULL);
        return 0;
  }
--- 2475,2479 ----
                oldSample->sample = newSample;
        }
!       Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_REQ_SAMPLE_LOAD, NULL, 0, NULL);
        return 0;
  }
***************
*** 2501,2505 ****
                result.index = data->index;
                sample->sample->ToPlayer (&result.sample);
!               Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_SAMPLE_RETRIEVE_REQ, &result, sizeof (player_audio_sample_t), 
NULL);
                return 0;
        }
--- 2501,2505 ----
                result.index = data->index;
                sample->sample->ToPlayer (&result.sample);
!               Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE, &result, sizeof (player_audio_sample_t), 
NULL);
                return 0;
        }
***************
*** 2557,2561 ****
        response.index = recDest;
        response.length = data->length;
!       Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_SAMPLE_REC_REQ, &response, sizeof (player_audio_sample_rec_req_t), 
NULL);
        return 0;
  }
--- 2557,2561 ----
        response.index = recDest;
        response.length = data->length;
!       Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_REQ_SAMPLE_REC, &response, sizeof (player_audio_sample_rec_req_t), 
NULL);
        return 0;
  }
***************
*** 2565,2569 ****
        player_audio_mixer_channel_list_detail_t result;
        MixerDetailsToPlayer (&result);
!       Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_MIXER_CHANNEL_LIST_REQ, &result, sizeof 
(player_audio_mixer_channel_list_detail_t), NULL);
  
        return 0;
--- 2565,2569 ----
        player_audio_mixer_channel_list_detail_t result;
        MixerDetailsToPlayer (&result);
!       Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_REQ_MIXER_CHANNEL_LIST, &result, sizeof 
(player_audio_mixer_channel_list_detail_t), NULL);
  
        return 0;
***************
*** 2574,2578 ****
        player_audio_mixer_channel_list_t result;
        MixerLevelsToPlayer (&result);
!       Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_MIXER_CHANNEL_LEVEL_REQ, &result, sizeof 
(player_audio_mixer_channel_list_t), NULL);
  
        return 0;
--- 2574,2578 ----
        player_audio_mixer_channel_list_t result;
        MixerLevelsToPlayer (&result);
!       Publish (device_addr, resp_queue, PLAYER_MSGTYPE_RESP_ACK, 
PLAYER_AUDIO_REQ_MIXER_CHANNEL_LEVEL, &result, sizeof 
(player_audio_mixer_channel_list_t), NULL);
  
        return 0;
***************
*** 2586,2623 ****
        if (pbHandle)
        {
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_CMD, PLAYER_AUDIO_WAV_PLAY_CMD);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_CMD, PLAYER_AUDIO_SAMPLE_PLAY_CMD);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_SAMPLE_LOAD_REQ);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_SAMPLE_RETRIEVE_REQ);
        }
        if (recHandle)
        {
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_CMD, PLAYER_AUDIO_WAV_STREAM_REC_CMD);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_SAMPLE_REC_REQ);
        }
        if (mixerHandle)
        {
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_CMD, PLAYER_AUDIO_MIXER_CHANNEL_CMD);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_MIXER_CHANNEL_LIST_REQ);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_MIXER_CHANNEL_LEVEL_REQ);
        }
  
        // Commands
!       if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_CMD, 
PLAYER_AUDIO_WAV_PLAY_CMD, device_addr) && pbHandle)
        {
                HandleWavePlayCmd (reinterpret_cast<player_audio_wav_t*> 
(data));
                return 0;
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_CMD, 
PLAYER_AUDIO_SAMPLE_PLAY_CMD, device_addr) && pbHandle)
        {
                HandleSamplePlayCmd 
(reinterpret_cast<player_audio_sample_item_t*> (data));
                return 0;
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_CMD, 
PLAYER_AUDIO_WAV_STREAM_REC_CMD, device_addr) && recHandle)
        {
                HandleRecordCmd (reinterpret_cast<player_bool_t*> (data));
                return 0;
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_CMD, 
PLAYER_AUDIO_MIXER_CHANNEL_CMD, device_addr) && mixerHandle)
        {
                HandleMixerChannelCmd 
(reinterpret_cast<player_audio_mixer_channel_list_t*> (data));
--- 2586,2623 ----
        if (pbHandle)
        {
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_CMD, PLAYER_AUDIO_CMD_WAV_PLAY);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_CMD, PLAYER_AUDIO_CMD_SAMPLE_PLAY);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_REQ_SAMPLE_LOAD);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE);
        }
        if (recHandle)
        {
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_CMD, PLAYER_AUDIO_CMD_WAV_STREAM_REC);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_REQ_SAMPLE_REC);
        }
        if (mixerHandle)
        {
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_CMD, PLAYER_AUDIO_CMD_MIXER_CHANNEL);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_REQ_MIXER_CHANNEL_LIST);
!               HANDLE_CAPABILITY_REQUEST (device_addr, resp_queue, hdr, data, 
PLAYER_MSGTYPE_REQ, PLAYER_AUDIO_REQ_MIXER_CHANNEL_LEVEL);
        }
  
        // Commands
!       if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_CMD, 
PLAYER_AUDIO_CMD_WAV_PLAY, device_addr) && pbHandle)
        {
                HandleWavePlayCmd (reinterpret_cast<player_audio_wav_t*> 
(data));
                return 0;
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_CMD, 
PLAYER_AUDIO_CMD_SAMPLE_PLAY, device_addr) && pbHandle)
        {
                HandleSamplePlayCmd 
(reinterpret_cast<player_audio_sample_item_t*> (data));
                return 0;
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_CMD, 
PLAYER_AUDIO_CMD_WAV_STREAM_REC, device_addr) && recHandle)
        {
                HandleRecordCmd (reinterpret_cast<player_bool_t*> (data));
                return 0;
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_CMD, 
PLAYER_AUDIO_CMD_MIXER_CHANNEL, device_addr) && mixerHandle)
        {
                HandleMixerChannelCmd 
(reinterpret_cast<player_audio_mixer_channel_list_t*> (data));
***************
*** 2625,2645 ****
        }
        // Requests
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_SAMPLE_LOAD_REQ, device_addr) && pbHandle)
        {
                return HandleSampleLoadReq 
(reinterpret_cast<player_audio_sample_t*> (data), resp_queue);
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_SAMPLE_RETRIEVE_REQ, device_addr) && pbHandle)
        {
                return HandleSampleRetrieveReq 
(reinterpret_cast<player_audio_sample_t*> (data), resp_queue);
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_SAMPLE_REC_REQ, device_addr) && recHandle)
        {
                return HandleSampleRecordReq 
(reinterpret_cast<player_audio_sample_rec_req_t*> (data), resp_queue);
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_MIXER_CHANNEL_LIST_REQ, device_addr) && mixerHandle)
        {
                return HandleMixerChannelListReq 
(reinterpret_cast<player_audio_mixer_channel_list_detail_t*> (data), 
resp_queue);
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_MIXER_CHANNEL_LEVEL_REQ, device_addr) && mixerHandle)
        {
                return HandleMixerChannelLevelReq 
(reinterpret_cast<player_audio_mixer_channel_list_t*> (data), resp_queue);
--- 2625,2645 ----
        }
        // Requests
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_REQ_SAMPLE_LOAD, device_addr) && pbHandle)
        {
                return HandleSampleLoadReq 
(reinterpret_cast<player_audio_sample_t*> (data), resp_queue);
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE, device_addr) && pbHandle)
        {
                return HandleSampleRetrieveReq 
(reinterpret_cast<player_audio_sample_t*> (data), resp_queue);
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_REQ_SAMPLE_REC, device_addr) && recHandle)
        {
                return HandleSampleRecordReq 
(reinterpret_cast<player_audio_sample_rec_req_t*> (data), resp_queue);
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_REQ_MIXER_CHANNEL_LIST, device_addr) && mixerHandle)
        {
                return HandleMixerChannelListReq 
(reinterpret_cast<player_audio_mixer_channel_list_detail_t*> (data), 
resp_queue);
        }
!       else if (Message::MatchMessage (hdr, PLAYER_MSGTYPE_REQ, 
PLAYER_AUDIO_REQ_MIXER_CHANNEL_LEVEL, device_addr) && mixerHandle)
        {
                return HandleMixerChannelLevelReq 
(reinterpret_cast<player_audio_mixer_channel_list_t*> (data), resp_queue);


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to