VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
playSoundController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 #include <vlutil/vlString.h>
15 #include <matrix/vlVector.h>
18 
20 class DtSimMessage;
22 class DtPlaySoundPSR;
23 
29 
31 {
32 public:
35  DtPlaySoundController(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
36  DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
37 
39  virtual ~DtPlaySoundController() override;
40 
41  virtual bool init() override;
42 
45  virtual const char* type() const override;
46 
47  static void playSoundCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
48 
52  static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager,
53  DtComponentDescriptor* desc = 0, DtReaderWriterRegistry* parentRegistry = 0);
54 
56  virtual void registerTaskMsgCallbacks() override;
57 
58  virtual AcceptLevel acceptTask(const DtTaskMessage& task) override;
59 
60  virtual void sendSoundEvent(const DtEntityType& entity);
61 
62  virtual DtTime durationForSoundType(const DtEntityType& entity) const;
63 
65  virtual void tick() override;
66 
71  static void requestSoundListCallback(const DtVrfObjectMessage* msg, void* usr);
72 
78  virtual void processRequestSoundList(const DtVrfObjectMessage* msg);
79 
80 protected:
81  virtual void processPlaySound(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
82 
86 
89 
92 
98  virtual bool createPSR();
99 
100 protected:
102 
106 };
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Instances of DtPlaySoundDescriptor are used to specify the parameters for a DtPlaySoundController.
Definition: playSoundDescriptor.h:22
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual void registerTaskMsgCallbacks()
AcceptLevel
Levels that a task controller can accept a task it has registered for.
Definition: taskControllerComponent.h:55
Definition: playSoundPSR.h:29
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
DtPlaySoundPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: playSoundController.h:105
virtual bool init() override
Calls setRadio()
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation frame...
DtPlaySoundController is a controller that plays sounds in response to DtPlaySoundTask tasks...
Definition: playSoundController.h:30
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:97
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
const DtPlaySoundDescriptor * myPlaySoundDescriptor
Definition: playSoundController.h:101
virtual AcceptLevel acceptTask(const DtTaskMessage &task)
Called by the task manager when this controller is being considered to execute a task. Only tasks which already match types that this controller has registered for will be passed. This is used for the case where multiple task controllers have registered for the same task type. This gives the controller a chance to look at the parameters of the task and to reject the execution of the task based on parameters. Controllers can return any of the AcceptLevel levels. The task manager will choose a controller with the lowest AcceptLevel to execute, but will not choose any controller that returns AcceptLevel_NoAccept. Default implementation returns AcceptLevel_Accept. Override this to check parameters and conditionally return a different AccpetLevel.
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)