Commit d990344f authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Update to use new controller selection terminology

Detail:
  c/module - Update references to SoundDMA SWIs and rename some functions/variables so that audio controller devices are referred to as "Controller" rather than "Device". Apart from the necessity to use the new SWI name & flag/reason code constants this is effectively just a cosmetic change to the sources.
Admin:
  Tested on Raspberry Pi
  Requires Sound0HAL-1_84 / Sound0Trid-1_69 / Sound0-1_72


Version 1.05. Tagged as 'SoundCtrl-1_05'
parent 825613b7
/* (1.04)
/* (1.05)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.04
#define Module_MajorVersion_CMHG 1.05
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 01 Dec 2015
#define Module_Date_CMHG 08 Jun 2016
#define Module_MajorVersion "1.04"
#define Module_Version 104
#define Module_MajorVersion "1.05"
#define Module_Version 105
#define Module_MinorVersion ""
#define Module_Date "01 Dec 2015"
#define Module_Date "08 Jun 2016"
#define Module_ApplicationDate "01-Dec-15"
#define Module_ApplicationDate "08-Jun-16"
#define Module_ComponentName "SoundCtrl"
#define Module_ComponentPath "castle/RiscOS/Sources/Audio/SoundCtrl"
#define Module_FullVersion "1.04"
#define Module_HelpVersion "1.04 (01 Dec 2015)"
#define Module_LibraryVersionInfo "1:4"
#define Module_FullVersion "1.05"
#define Module_HelpVersion "1.05 (08 Jun 2016)"
#define Module_LibraryVersionInfo "1:5"
......@@ -338,21 +338,21 @@ static void RemoveDevice(struct mixer_device *device)
}
static bool SoundDMA_DeviceSelection(void)
static bool SoundDMA_ControllerSelection(void)
{
uint32_t ret,flags;
/* Check if device selection & enumeration functionality is available */
if (_swix(Sound_ReadSysInfo, _IN(0)|_OUTR(0,1), Sound_RSI_Features, &ret, &flags))
{
dprintf(("", "DeviceSelection: SWI error\n"));
dprintf(("", "ControllerSelection: SWI error\n"));
return false;
}
if (ret || !(flags & Sound_RSI_Feature_DeviceSelection))
if (ret || !(flags & Sound_RSI_Feature_ControllerSelection))
{
dprintf(("", "DeviceSelection: no\n"));
dprintf(("", "ControllerSelection: no\n"));
return false;
}
dprintf(("", "DeviceSelection: yes\n"));
dprintf(("", "ControllerSelection: yes\n"));
return true;
}
......@@ -366,28 +366,28 @@ static void MixVolumeCommand(const char *arg_string, int argc)
system_t *system = NULL;
uint32_t channel;
if (SoundDMA_DeviceSelection())
if (SoundDMA_ControllerSelection())
{
/* Accept "0" or a device ID */
/* Accept "0" or a controller ID */
struct mixer_device *device;
char temp[128];
const char *device_id;
const char *controller_id;
if ((arg_string[0] == '0') && isspace(arg_string[0]))
{
/* Get current device ID */
if (_swix(Sound_ReadSysInfo, _INR(0,2), Sound_RSI_DefaultDevice, temp, sizeof(temp)))
if (_swix(Sound_ReadSysInfo, _INR(0,2), Sound_RSI_DefaultController, temp, sizeof(temp)))
{
return;
}
device_id = temp;
controller_id = temp;
}
else
{
device_id = arg_string;
controller_id = arg_string;
}
dprintf(("", "Looking for mixer for '%s'\n",device_id));
dprintf(("", "Looking for mixer for '%s'\n",controller_id));
/* Get mixer from device ID */
if (_swix(Sound_DeviceInfo, _INR(0,3), device_id, &device, sizeof(device), Sound_DevInfo_MixerDevice))
if (_swix(Sound_ControllerInfo, _INR(0,3), controller_id, &device, sizeof(device), Sound_CtlrInfo_MixerDevice))
{
return;
}
......@@ -569,28 +569,28 @@ static _kernel_oserror *FindSystemBlockByDevice(struct mixer_device *device, sys
static _kernel_oserror *FindSystemBlockForSWI(int r0, system_t **system)
{
_kernel_oserror *e;
if (SoundDMA_DeviceSelection())
if (SoundDMA_ControllerSelection())
{
/* Accept NULL or a string pointer */
struct mixer_device *device;
char temp[128];
char *device_id;
char *controller_id;
if (!r0)
{
/* Get current device ID */
if ((e = _swix(Sound_ReadSysInfo, _INR(0,2), Sound_RSI_DefaultDevice, temp, sizeof(temp))) != NULL)
/* Get current controller ID */
if ((e = _swix(Sound_ReadSysInfo, _INR(0,2), Sound_RSI_DefaultController, temp, sizeof(temp))) != NULL)
{
return e;
}
device_id = temp;
controller_id = temp;
}
else
{
device_id = (char *) r0;
controller_id = (char *) r0;
}
dprintf(("", "Looking for mixer for '%s'\n",device_id));
/* Get mixer from device ID */
if ((e = _swix(Sound_DeviceInfo, _INR(0,3), device_id, &device, sizeof(device), Sound_DevInfo_MixerDevice)) != NULL)
dprintf(("", "Looking for mixer for '%s'\n",controller_id));
/* Get mixer from controller ID */
if ((e = _swix(Sound_ControllerInfo, _INR(0,3), controller_id, &device, sizeof(device), Sound_CtlrInfo_MixerDevice)) != NULL)
{
return e;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment