Mercurial > hg > aimc
comparison trunk/src/Modules/Input/ModuleFileInput.h @ 280:e55d0c225a57
- Lots of changes to make cpplint happy. It still complains about header guards, but that's pretty much it now.
author | tomwalters |
---|---|
date | Thu, 18 Feb 2010 21:12:41 +0000 |
parents | f469d936337f |
children | ef14c9f2c1d2 |
comparison
equal
deleted
inserted
replaced
279:f469d936337f | 280:e55d0c225a57 |
---|---|
35 #include "Support/SignalBank.h" | 35 #include "Support/SignalBank.h" |
36 | 36 |
37 namespace aimc { | 37 namespace aimc { |
38 class ModuleFileInput : public Module { | 38 class ModuleFileInput : public Module { |
39 public: | 39 public: |
40 ModuleFileInput(Parameters *pParam); | 40 explicit ModuleFileInput(Parameters *pParam); |
41 virtual ~ModuleFileInput(); | 41 virtual ~ModuleFileInput(); |
42 | 42 |
43 /*! \brief Initializes this input device using an audio file | 43 /*! \brief Initializes this input device using an audio file |
44 * \param sFilename Path of the file to load | 44 * \param sFilename Path of the file to load |
45 * \return true on success, false on error | 45 * \return true on success, false on error |
46 */ | 46 */ |
47 bool LoadFile(const char *sFilename); | 47 bool LoadFile(const char *sFilename); |
48 | 48 |
49 //! \brief Process the loaded file. | 49 /*! \brief Process the loaded file. |
50 */ | |
50 void Process(); | 51 void Process(); |
51 | 52 |
52 //! \brief Dummy Initialize function. Call LoadFile instead. | 53 /*! \brief Dummy Initialize function. Call LoadFile instead. |
54 */ | |
53 virtual bool Initialize(const SignalBank &input); | 55 virtual bool Initialize(const SignalBank &input); |
54 | 56 |
55 //! \brief Dummy funciton to comply with the Module specification. Gives an | 57 /*! \brief Dummy funciton to comply with the Module specification. Gives an |
56 // error message when called. | 58 * error message when called. |
59 */ | |
57 virtual void Process(const SignalBank &input); | 60 virtual void Process(const SignalBank &input); |
58 | 61 |
59 private: | 62 private: |
60 //! \brief Prepare the module | 63 /*! \brief Prepare the module |
61 //! \param input Input SignalBank | 64 * \param input Input SignalBank |
62 //! \param output true on success false on failure | 65 * \param output true on success false on failure |
66 */ | |
63 virtual bool InitializeInternal(const SignalBank &input); | 67 virtual bool InitializeInternal(const SignalBank &input); |
64 | 68 |
65 //! \brief Rewind to the start of the file | 69 /*! \brief Rewind to the start of the file |
70 */ | |
66 virtual void ResetInternal(); | 71 virtual void ResetInternal(); |
67 | 72 |
68 //! \brief File descriptor | 73 /*! \brief File descriptor |
74 */ | |
69 SNDFILE *file_handle_; | 75 SNDFILE *file_handle_; |
70 | 76 |
71 //! \brief Current position in time of the file | 77 /*! \brief Current position in time of the file |
78 */ | |
72 int file_position_samples_; | 79 int file_position_samples_; |
73 bool file_loaded_; | 80 bool file_loaded_; |
74 int audio_channels_; | 81 int audio_channels_; |
75 int buffer_length_; | 82 int buffer_length_; |
76 float sample_rate_; | 83 float sample_rate_; |
77 }; | 84 }; |
78 } // namespace aimc | 85 } // namespace aimc |
79 | 86 |
80 #endif // _AIMC_MODULES_INPUT_FILE_H_ | 87 #endif // _AIMC_MODULES_INPUT_FILE_H_ |