#pragma once #include "watcher.h" #include "audio.h" #include "simulate.h" #include "objstrm.h" #include "controls.h" #include "motion.h" //########################################################################## //######################## AudioIdleWatcher ########################## //########################################################################## class AudioIdleWatcher: public Component { public: // //----------------------------------------------------------------------- // Constructor, Destructor, Testing //----------------------------------------------------------------------- // AudioIdleWatcher( PlugStream *stream, Entity *entity ); void AudioIdleWatcherX( AudioComponent *audio_component, Entity *entity ); ~AudioIdleWatcher(); Logical TestInstance() const; // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); // //----------------------------------------------------------------------- // ReleaseLinkHandler //----------------------------------------------------------------------- // void ReleaseLinkHandler( Socket *socket, Plug *plug ); // //----------------------------------------------------------------------- // Execute //----------------------------------------------------------------------- // void Execute(); protected: // //----------------------------------------------------------------------- // Protected data //----------------------------------------------------------------------- // SlotOf audioComponentSocket; }; //########################################################################## //########################### AudioWatcherOf ######################### //########################################################################## template class AudioWatcherOf: public AttributeWatcherOf { public: // //-------------------------------------------------------------------- // Constructor, Destructor, Testing //-------------------------------------------------------------------- // AudioWatcherOf( PlugStream *stream, Entity *entity ); ~AudioWatcherOf(); Logical TestInstance() const; // //-------------------------------------------------------------------- // BuildFromPage //-------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); // //-------------------------------------------------------------------- // ReleaseLinkHandler //-------------------------------------------------------------------- // void ReleaseLinkHandler( Socket *socket, Plug *plug ); protected: // //-------------------------------------------------------------------- // Protected data //-------------------------------------------------------------------- // SlotOf audioComponentSocket; }; //~~~~~~~~~~~~~~~~~~~~~~~~ AudioWatcherOf templates ~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioWatcherOf::AudioWatcherOf( PlugStream *stream, Entity *entity ): AttributeWatcherOf(stream, entity), audioComponentSocket(this) { // // Get audio component // AudioComponent *audio_component; PlugStream_ReadObjectIDAndFindPlug(stream, &audio_component); Check(audio_component); audioComponentSocket.Add(audio_component); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioWatcherOf::~AudioWatcherOf() { } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioWatcherOf::BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ) { AttributeWatcherOf::BuildFromPage( stream, name_list, class_ID, object_ID ); // // Store audio_component object ID // CString audio_component_name("audio_component"); PlugStream_FindEntryAndWriteObjectID( stream, name_list, audio_component_name ); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template Logical AudioWatcherOf::TestInstance() const { AttributeWatcherOf::TestInstance(); Check(&audioComponentSocket); return True; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioWatcherOf::ReleaseLinkHandler( Socket *socket, Plug *plug ) { if (socket == &audioComponentSocket) { Check(&audioComponentSocket); Check(socket); Unregister_Object(this); delete this; } else { AttributeWatcherOf::ReleaseLinkHandler(socket, plug); } } //########################################################################## //########################### AudioTriggerOf ######################### //########################################################################## template class AudioTriggerOf: public AudioWatcherOf { public: // //-------------------------------------------------------------------- // Constructor //-------------------------------------------------------------------- // AudioTriggerOf( PlugStream *stream, Entity *entity ); ~AudioTriggerOf(); // //-------------------------------------------------------------------- // BuildFromPage //-------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //-------------------------------------------------------------------- // SendNotificationOfChange //-------------------------------------------------------------------- // void SendNotificationOfChange(); // //-------------------------------------------------------------------- // ExtractInterestingValue //-------------------------------------------------------------------- // virtual AudioControlValue ExtractInterestingValue(const T *attribute_ptr); private: // //-------------------------------------------------------------------- // Private data //-------------------------------------------------------------------- // Scalar attributeValueThreshold; Logical inverseTrigger; AudioControlID controlIDOn, controlIDOff; AudioControlValue controlValueOn, controlValueOff; Logical triggerOn; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AudioTriggerOf templates ~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioTriggerOf::AudioTriggerOf( PlugStream *stream, Entity *entity ): AudioWatcherOf(stream, entity) { Check(simulation); simulation->AddAudioWatcher(this); // // Get other fields // MemoryStream_Read(stream, &attributeValueThreshold); MemoryStream_Read(stream, &inverseTrigger); MemoryStream_Read(stream, &controlIDOn); MemoryStream_Read(stream, &controlIDOff); MemoryStream_Read(stream, &controlValueOn); MemoryStream_Read(stream, &controlValueOff); triggerOn = False; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioTriggerOf::~AudioTriggerOf() { } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioTriggerOf::BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ) { AudioWatcherOf::BuildFromPage(stream, name_list, class_ID, object_ID); // // Store other fields // MEM_STRM_WRITE_ENTRY( *stream, name_list, AudioControlValue, attribute_value_threshold ); MEM_STRM_WRITE_ENTRY( *stream, name_list, Logical, inverse_trigger ); MEM_STRM_WRITE_ENTRY( *stream, name_list, Enumeration, control_ID_on ); MEM_STRM_WRITE_ENTRY( *stream, name_list, Enumeration, control_ID_off ); MEM_STRM_WRITE_ENTRY( *stream, name_list, AudioControlValue, control_value_on ); MEM_STRM_WRITE_ENTRY( *stream, name_list, AudioControlValue, control_value_off ); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioTriggerOf::SendNotificationOfChange() { // // Get current value // T *attribute_ptr = GetCurrentPointer(); Check_Pointer(attribute_ptr); Scalar current_value = ExtractInterestingValue(attribute_ptr); if (triggerOn) { if ( (!inverseTrigger && current_value <= attributeValueThreshold) || (inverseTrigger && current_value >= attributeValueThreshold) ) { Check(&audioComponentSocket); Check(audioComponentSocket.GetCurrent()); #if 1 audioComponentSocket.GetCurrent()->ReceiveControl( controlIDOff, controlValueOff ); #else audioComponentSocket.GetCurrent()->PostReceiveControl( controlIDOff, controlValueOff ); #endif triggerOn = False; } } else { if ( (!inverseTrigger && current_value > attributeValueThreshold) || (inverseTrigger && current_value < attributeValueThreshold) ) { Check(&audioComponentSocket); Check(audioComponentSocket.GetCurrent()); #if 1 audioComponentSocket.GetCurrent()->ReceiveControl( controlIDOn, controlValueOn ); #else audioComponentSocket.GetCurrent()->PostReceiveControl( controlIDOn, controlValueOn ); #endif triggerOn = True; } } } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioControlValue AudioTriggerOf::ExtractInterestingValue(const T*) { Fail("AudioTriggerOf::ExtractInterestingValue - Should never reach here"); return 0; } //########################################################################## //########################### AudioScaleOf ########################### //########################################################################## template class AudioScaleOf: public AudioWatcherOf { public: // //-------------------------------------------------------------------- // Constructor, Destructor //-------------------------------------------------------------------- // AudioScaleOf( PlugStream *stream, Entity *entity ); ~AudioScaleOf(); // //-------------------------------------------------------------------- // BuildFromPage //-------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //-------------------------------------------------------------------- // SendNotificationOfChange //-------------------------------------------------------------------- // void SendNotificationOfChange(); // //-------------------------------------------------------------------- // ExtractInterestingValue //-------------------------------------------------------------------- // virtual AudioControlValue ExtractInterestingValue(const T *attribute_ptr); private: // //-------------------------------------------------------------------- // Private data //-------------------------------------------------------------------- // Scalar attributeValueBoundary1, attributeValueBoundary2; AudioControlID controlID; AudioControlValue controlValueBoundary1, controlValueBoundary2; Scalar exponent; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AudioScaleOf templates ~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioScaleOf::AudioScaleOf( PlugStream *stream, Entity *entity ): AudioWatcherOf(stream, entity) { // // Get audio component // AudioComponent *audio_component = audioComponentSocket.GetCurrent(); Check(audio_component); audio_component->AddWatcher(this); // // Get other fields // MemoryStream_Read(stream, &attributeValueBoundary1); MemoryStream_Read(stream, &attributeValueBoundary2); MemoryStream_Read(stream, &controlID); MemoryStream_Read(stream, &controlValueBoundary1); MemoryStream_Read(stream, &controlValueBoundary2); MemoryStream_Read(stream, &exponent); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioScaleOf::~AudioScaleOf() { } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioScaleOf::BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ) { AudioWatcherOf::BuildFromPage(stream, name_list, class_ID, object_ID); // // Store other fields // MEM_STRM_WRITE_ENTRY( *stream, name_list, Scalar, attribute_value_boundary1 ); MEM_STRM_WRITE_ENTRY( *stream, name_list, Scalar, attribute_value_boundary2 ); MEM_STRM_WRITE_ENTRY( *stream, name_list, Enumeration, control_ID ); MEM_STRM_WRITE_ENTRY( *stream, name_list, AudioControlValue, control_value_boundary1 ); MEM_STRM_WRITE_ENTRY( *stream, name_list, AudioControlValue, control_value_boundary2 ); MEM_STRM_WRITE_ENTRY( *stream, name_list, Scalar, exponent ); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioScaleOf::SendNotificationOfChange() { // // Get current value // T *attribute_ptr = GetCurrentPointer(); Check_Pointer(attribute_ptr); Scalar current_value = ExtractInterestingValue(attribute_ptr); // // Clamp value within range // Scalar min_attribute_boundary = Min(attributeValueBoundary1, attributeValueBoundary2); Scalar max_attribute_boundary = Max(attributeValueBoundary1, attributeValueBoundary2); Clamp(current_value, min_attribute_boundary, max_attribute_boundary); Verify( current_value >= min_attribute_boundary && current_value <= max_attribute_boundary ); // // Calculate scale // Verify(!Small_Enough(attributeValueBoundary2 - attributeValueBoundary1)); Scalar current_scale = (current_value - attributeValueBoundary1) / (attributeValueBoundary2 - attributeValueBoundary1); Verify(current_scale >= -1.0f && current_scale <= 1.0f); // // Apply exponent // if (exponent != 1.0f) { Scalar old_scale = current_scale; // HACK - for debugging current_scale = pow(old_scale, exponent); #if DEBUG_LEVEL>0 if (!(current_scale >= -1.0f && current_scale <= 1.0f)) { Dump(old_scale); Dump(exponent); Dump(current_scale); } #endif } Verify(current_scale >= -1.0f && current_scale <= 1.0f); // // Calculate control value // AudioControlValue control_value = current_scale * (controlValueBoundary2 - controlValueBoundary1) + controlValueBoundary1; #if DEBUG_LEVEL>0 AudioControlValue min_control_boundary = Min(controlValueBoundary1, controlValueBoundary2); AudioControlValue max_control_boundary = Max(controlValueBoundary1, controlValueBoundary2); Verify( control_value >= min_control_boundary && control_value <= max_control_boundary ); #endif Check(&audioComponentSocket); Check(audioComponentSocket.GetCurrent()); audioComponentSocket.GetCurrent()->ReceiveControl( controlID, control_value ); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioControlValue AudioScaleOf::ExtractInterestingValue(const T*) { Fail("AudioScaleOf::ExtractInterestingValue - Should never reach here"); return 0; } //########################################################################## //########################## AudioMatchOf ############################ //########################################################################## template class AudioMatchOf: public AudioWatcherOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioMatchOf( PlugStream *stream, Entity *entity ); ~AudioMatchOf(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // SendNotificationOfChange //----------------------------------------------------------------------- // void SendNotificationOfChange(); // //----------------------------------------------------------------------- // ExtractInterestingValue //----------------------------------------------------------------------- // virtual int ExtractInterestingValue(const T *attribute_ptr); private: // //----------------------------------------------------------------------- // Private data //----------------------------------------------------------------------- // int attributeMatchValue; AudioControlID controlID; AudioControlValue controlValue; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~ AudioMatchOf templates ~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioMatchOf::AudioMatchOf( PlugStream *stream, Entity *entity ): AudioWatcherOf(stream, entity) { Check(simulation); simulation->AddAudioWatcher(this); // // Get other fields // MemoryStream_Read(stream, &attributeMatchValue); MemoryStream_Read(stream, &controlID); MemoryStream_Read(stream, &controlValue); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioMatchOf::~AudioMatchOf() { } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioMatchOf::BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ) { AudioWatcherOf::BuildFromPage(stream, name_list, class_ID, object_ID); // // Store other fields // MEM_STRM_WRITE_ENTRY( *stream, name_list, int, attribute_match_value ); MEM_STRM_WRITE_ENTRY( *stream, name_list, Enumeration, control_ID ); MEM_STRM_WRITE_ENTRY( *stream, name_list, AudioControlValue, control_value ); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioMatchOf::SendNotificationOfChange() { // // Get current value // T *attribute_ptr = GetCurrentPointer(); Check_Pointer(attribute_ptr); int current_value = ExtractInterestingValue(attribute_ptr); if (current_value == attributeMatchValue) { Check(&audioComponentSocket); Check(audioComponentSocket.GetCurrent()); #if 1 audioComponentSocket.GetCurrent()->ReceiveControl( controlID, controlValue ); #else audioComponentSocket.GetCurrent()->PostReceiveControl( controlID, controlValue ); #endif } } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template int AudioMatchOf::ExtractInterestingValue(const T*) { Fail("AudioMatchOf::ExtractInterestingValue - Should never reach here"); return 0; } //########################################################################## //########################## AudioDeltaOf ############################ //########################################################################## template class AudioDeltaOf: public AudioWatcherOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioDeltaOf( PlugStream *stream, Entity *entity ); ~AudioDeltaOf(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // SendNotificationOfChange //----------------------------------------------------------------------- // void SendNotificationOfChange(); private: // //----------------------------------------------------------------------- // Private data //----------------------------------------------------------------------- // T lastValue; T deltaTrigger; AudioControlID controlID; AudioControlValue controlValue; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~ AudioDeltaOf templates ~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioDeltaOf::AudioDeltaOf( PlugStream *stream, Entity *entity ): AudioWatcherOf(stream, entity) { Check(simulation); simulation->AddAudioWatcher(this); MemoryStream_Read(stream, &controlID); MemoryStream_Read(stream, &controlValue); MemoryStream_Read(stream, &deltaTrigger); lastValue = GetCurrentValue(); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template AudioDeltaOf::~AudioDeltaOf() { } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioDeltaOf::BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ) { AudioWatcherOf::BuildFromPage(stream, name_list, class_ID, object_ID); // // control_ID, control_value // MEM_STRM_WRITE_ENTRY( *stream, name_list, Enumeration, control_ID ); MEM_STRM_WRITE_ENTRY( *stream, name_list, AudioControlValue, control_value ); // // delta_value // T delta_trigger = SMALL; if (name_list->FindData("delta_trigger") != NULL) { Convert_From_Ascii( (const char *)name_list->FindData("delta_trigger"), &delta_trigger ); } MemoryStream_Write(stream, &delta_trigger); } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ template void AudioDeltaOf::SendNotificationOfChange() { T *attribute_ptr; T delta_change; attribute_ptr = GetCurrentPointer(); Check_Pointer(attribute_ptr); delta_change = *attribute_ptr - lastValue; if (Abs(delta_change) >= deltaTrigger) { lastValue = *attribute_ptr; Check(&audioComponentSocket); Check(audioComponentSocket.GetCurrent()); #if 1 audioComponentSocket.GetCurrent()->ReceiveControl( controlID, controlValue ); #else audioComponentSocket.GetCurrent()->PostReceiveControl( controlID, controlValue ); #endif } } //########################################################################## //########################### AudioMotionTrigger ##################### //########################################################################## enum MotionType { LinearMotionType = 0, AngularMotionType = 1 }; inline MemoryStream& MemoryStream_Read( MemoryStream *stream, MotionType *ptr ) {return stream->ReadBytes(ptr, sizeof(*ptr));} inline MemoryStream& MemoryStream_Write( MemoryStream *stream, const MotionType *ptr ) {return stream->WriteBytes(ptr, sizeof(*ptr));} enum MotionValue { XMotionValue = 0, YMotionValue = 1, ZMotionValue = 2, LengthMotionValue = 3 }; inline MemoryStream& MemoryStream_Read( MemoryStream *stream, MotionValue *ptr ) {return stream->ReadBytes(ptr, sizeof(*ptr));} inline MemoryStream& MemoryStream_Write( MemoryStream *stream, const MotionValue *ptr ) {return stream->WriteBytes(ptr, sizeof(*ptr));} class AudioMotionTrigger: public AudioTriggerOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioMotionTrigger( PlugStream *stream, Entity *entity ); ~AudioMotionTrigger(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // ExtractInterestingValue //----------------------------------------------------------------------- // AudioControlValue ExtractInterestingValue(const Motion *attribute_ptr); private: // //----------------------------------------------------------------------- // DumpValue //----------------------------------------------------------------------- // void DumpValue(const Motion *attribute_ptr); // //----------------------------------------------------------------------- // Private data //----------------------------------------------------------------------- // MotionType motionType; MotionValue motionValue; }; //########################################################################## //########################### AudioMotionScale ####################### //########################################################################## class AudioMotionScale: public AudioScaleOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioMotionScale( PlugStream *stream, Entity *entity ); ~AudioMotionScale(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // ExtractInterestingValue //----------------------------------------------------------------------- // AudioControlValue ExtractInterestingValue(const Motion *attribute_ptr); private: // //----------------------------------------------------------------------- // DumpValue //----------------------------------------------------------------------- // void DumpValue(const Motion *attribute_ptr); // //----------------------------------------------------------------------- // Private data //----------------------------------------------------------------------- // MotionType motionType; MotionValue motionValue; }; //########################################################################## //########################### AudioHingeScale ######################### //########################################################################## class AudioHingeScale: public AudioScaleOf { public: // //-------------------------------------------------------------------- // Constructor, Destructor, Testing //-------------------------------------------------------------------- // AudioHingeScale( PlugStream *stream, Entity *entity ); ~AudioHingeScale(); protected: // //-------------------------------------------------------------------- // ExtractInterestingValue //-------------------------------------------------------------------- // AudioControlValue ExtractInterestingValue(const Hinge *attribute_ptr); private: // //----------------------------------------------------------------------- // DumpValue //----------------------------------------------------------------------- // void DumpValue(const Hinge *attribute_ptr); }; //########################################################################## //########################### AudioScalarTrigger ##################### //########################################################################## class AudioScalarTrigger: public AudioTriggerOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioScalarTrigger( PlugStream *stream, Entity *entity ); ~AudioScalarTrigger(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // ExtractInterestingValue //----------------------------------------------------------------------- // AudioControlValue ExtractInterestingValue(const Scalar *attribute_ptr); }; //########################################################################## //###################### AudioScalarDeltaTrigger ##################### //########################################################################## class AudioScalarDeltaTrigger: public AudioDeltaOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioScalarDeltaTrigger( PlugStream *stream, Entity *entity ); ~AudioScalarDeltaTrigger(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); }; //########################################################################## //########################### AudioScalarScale ######################## //########################################################################## class AudioScalarScale: public AudioScaleOf { public: // //-------------------------------------------------------------------- // Constructor, Destructor, Testing //-------------------------------------------------------------------- // AudioScalarScale( PlugStream *stream, Entity *entity ); ~AudioScalarScale(); protected: // //-------------------------------------------------------------------- // ExtractInterestingValue //-------------------------------------------------------------------- // AudioControlValue ExtractInterestingValue(const Scalar *attribute_ptr); }; //########################################################################## //######################## AudioLogicalTrigger ####################### //########################################################################## class AudioLogicalTrigger: public AudioMatchOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioLogicalTrigger( PlugStream *stream, Entity *entity ); ~AudioLogicalTrigger(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // ExtractInterestingValue //----------------------------------------------------------------------- // int ExtractInterestingValue(const Logical *attribute_ptr); }; //########################################################################## //###################### AudioEnumerationTrigger ##################### //########################################################################## class AudioEnumerationTrigger: public AudioMatchOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioEnumerationTrigger( PlugStream *stream, Entity *entity ); ~AudioEnumerationTrigger(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // ExtractInterestingValue //----------------------------------------------------------------------- // int ExtractInterestingValue(const Enumeration *attribute_ptr); }; //########################################################################## //################### AudioEnumerationDeltaTrigger ################### //########################################################################## class AudioEnumerationDeltaTrigger: public AudioDeltaOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioEnumerationDeltaTrigger( PlugStream *stream, Entity *entity ); ~AudioEnumerationDeltaTrigger(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); }; //########################################################################## //####################### AudioIntegerTrigger ######################## //########################################################################## class AudioIntegerTrigger: public AudioTriggerOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioIntegerTrigger( PlugStream *stream, Entity *entity ); ~AudioIntegerTrigger(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // ExtractInterestingValue //----------------------------------------------------------------------- // AudioControlValue ExtractInterestingValue(const int *attribute_ptr); }; //########################################################################## //################### AudioControlsButtonTrigger ##################### //########################################################################## class AudioControlsButtonTrigger: public AudioTriggerOf { public: // //----------------------------------------------------------------------- // Constructor //----------------------------------------------------------------------- // AudioControlsButtonTrigger( PlugStream *stream, Entity *entity ); ~AudioControlsButtonTrigger(); // //----------------------------------------------------------------------- // BuildFromPage //----------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //----------------------------------------------------------------------- // ExtractInterestingValue //----------------------------------------------------------------------- // AudioControlValue ExtractInterestingValue(const ControlsButton *attribute_ptr); }; //########################################################################## //######################## AudioStateWatcher ######################### //########################################################################## class AudioStateWatcher: public AudioWatcherOf { public: // //-------------------------------------------------------------------- // Destructor //-------------------------------------------------------------------- // ~AudioStateWatcher(); protected: // //-------------------------------------------------------------------- // Constructor //-------------------------------------------------------------------- // AudioStateWatcher( PlugStream *stream, Entity *entity ); // //-------------------------------------------------------------------- // SendNotificationOfChange //-------------------------------------------------------------------- // void SendNotificationOfChange(); // //-------------------------------------------------------------------- // StateChanged //-------------------------------------------------------------------- // virtual void StateChanged( Enumeration old_state, Enumeration new_state ); }; //########################################################################## //########################### AudioStateTrigger ###################### //########################################################################## class AudioStateTrigger: public AudioStateWatcher { public: // //-------------------------------------------------------------------- // Constructor, Destructor //-------------------------------------------------------------------- // AudioStateTrigger( PlugStream *stream, Entity *entity ); ~AudioStateTrigger(); // //-------------------------------------------------------------------- // BuildFromPage //-------------------------------------------------------------------- // static void BuildFromPage( PlugStream *stream, NameList *name_list, ClassID class_ID, ObjectID object_ID ); protected: // //-------------------------------------------------------------------- // StateChanged //-------------------------------------------------------------------- // void StateChanged( Enumeration old_state, Enumeration new_state ); private: // //-------------------------------------------------------------------- // Private data //-------------------------------------------------------------------- // Enumeration triggerState; Logical inverseTrigger; AudioControlID controlID; AudioControlValue controlValue; Logical excludeTransition; Enumeration excludeState; };