Feedback programming

Solo disponible en BuenasTareas
  • Páginas : 12 (2953 palabras )
  • Descarga(s) : 0
  • Publicado : 23 de mayo de 2011
Leer documento completo
Vista previa del texto
Auto-Generated State Variables
/// new Number:m_totalInputs;
/// new Number:m_currentInput;
/// new InputSwitcher_Name:m_currentInputName;
/// new Number:m_totalInputsParent;
/// new Number:m_currentInputParent;
/// new InputSwitcher_Name:m_currentInputNameParent;
/// new Number:m_mode;
/// new m_currentSubtitle[ NAM_BUF_SIZE char ];
/// new m_currentAngle[ NAM_BUF_SIZE char ];/// new Play_PlayState:m_playState;
/// new Fixed:m_playSpeed;
/// new Delay:m_playElapsedTime;
/// new Delay:m_playRemainingTime;
/// new Power_State:m_powerStateParent;
/// new Repeat_RepeatState:m_repeatState = Repeat_RepeatState:Repeat_RepeatState_Off;
/// new Shuffle_Type:m_shuffleState = Shuffle_Type:Shuffle_Type_Off;
/// new Number:m_tunerPresetCountParent;
/// newNumber:m_tunerPresetPageCountParent;
/// new Number:m_tunerSelectedPresetParent;
/// new Number:m_tunerSelectedPresetPageParent;
/// new m_tunerSelectedPresetNameParent[ NAM_BUF_SIZE char ];
/// new m_tunerSelectedPresetPageNameParent[ NAM_BUF_SIZE char ];
/// new bool:m_tunerSignalLockParent;
/// new Tuner_Band:m_tunerActiveBandParent;
/// new Frequency:m_tunerSelectedFrequencyParent;/// new Tuner_StereoPresense:m_tunerStereoTypeParent;
/// new m_tunerCategoryParent[ NAM_BUF_SIZE char ];
/// new OffsetPercentage:m_fadeParent;
/// new Percentage:m_maxVolumeParent = Percentage:100;
/// new OffsetPercentage:m_bassParent;
/// new OffsetPercentage:m_trebleParent;
/// new OffsetPercentage:m_balanceParent;
/// new Percentage:m_volumeParent;
/// newVolume2_VolumeState:m_muteStateParent;
/// new Volume2_VolumeState:m_loudnessStateParent;
//
// This method gets called when the driver is initially configured
// A driver will be "initially configured" when programming that
// impacts this driver changes and/or when the controller gets
// reset.
//

#include
new m_zoneInputName[256 char];
InitializeDriver()
{
}

GetValStringByPosition(position,{_,Text}:Text[], size)
{
ValString_Get(ValString:GetChildVid(position), Text, size);
}

SetValStringByPosition(position, Text[])
{
ValString_Set(ValString:GetChildVid(position), Text);
}

//
// Feedback Match Inputsource
//
bool:MatchInputsource( message[] )
{
new bool:retval = false;

new matches[ 3 ][ RegEx_Match_Type ];
new regex:re = RegEx_Create("!1(SLI|SLZ|SL3|SL4)([0-9A-Za-z]+)" );
if ( RegEx_Match( re, message, matches, 3 ))
{
LogMsg3( "%s: Feedback Matched 'Inputsource'", m_name );
LogMsg3(" RegEx: !1(SLI|SLZ|SL3|SL4)([0-9A-Za-z]+)");
retval = true;

new inputZoneStartIndex = matches[ 1 ][ RegEx_Match_Type_Begin ];
new inputZoneLength = matches[ 1 ][ RegEx_Match_Type_End ] - inputZoneStartIndex;
new ZoneStr[ 4 char ];StrMid(ZoneStr, message, inputZoneStartIndex, inputZoneLength );
new m_zonePosition;

if(StrCompare(ZoneStr,"SLI")==0)
{
m_zonePosition = 12;
}
else if(StrCompare(ZoneStr,"SLZ")==0)
{
m_zonePosition = 13;
}
else if(StrCompare(ZoneStr,"SL3")==0)
{
m_zonePosition = 14;
}
else if(StrCompare(ZoneStr,"SL4")==0)
{
m_zonePosition = 15;
}LogMsg3( " Match 1: inputZonePosition = %d", m_zonePosition );

new inputStartIndex = matches[ 2 ][ RegEx_Match_Type_Begin ];
new inputLength = matches[ 2 ][ RegEx_Match_Type_End ] - inputStartIndex;
new inputStr[ 4 char ];
StrMid(inputStr, message, inputStartIndex, inputLength );
new inputNum = StrToInt(inputStr);
if(message{5}==0x32 && message{6}==0x41)
{m_zoneInputName = "USB REAR";
}
else if(inputNum == 0)
{
m_zoneInputName = "VCR/DVR";
}
else if(inputNum == 1)
{
m_zoneInputName = "CLB/SAT";
}
else if(inputNum == 2)
{
m_zoneInputName = "GAME/TV";
}
else if(inputNum == 3)
{
m_zoneInputName = "AUX1";
}
else if(inputNum == 4)
{
m_zoneInputName = "AUX2";
}
else if(inputNum == 5)
{...
tracking img