Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
ToneBuffer.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2 / Title : Isomet Tone Buffer Header
3 / Project : Isomet Modular Synthesiser System
4 /------------------------------------------------------------------------------
5 / File : $URL: http://nutmeg.qytek.lan/svn/sw/trunk/09-Isomet/iMS_SDK/API/ToneBuffer/h/ToneBuffer.h $
6 / Author : $Author: dave $
7 / Company : Isomet (UK) Ltd
8 / Created : 2016-02-24
9 / Last update: $Date: 2017-09-11 23:55:34 +0100 (Mon, 11 Sep 2017) $
10 / Platform :
11 / Standard : C++11
12 / Revision : $Rev: 300 $
13 /------------------------------------------------------------------------------
14 / Description:
15 /------------------------------------------------------------------------------
16 / Copyright (c) 2016 Isomet (UK) Ltd. All Rights Reserved.
17 /------------------------------------------------------------------------------
18 / Revisions :
19 / Date Version Author Description
20 / 2016-02-24 1.0 dc Created
21 /
22 /----------------------------------------------------------------------------*/
23 
34 
35 #ifndef IMS_TONEBUFFER_H__
36 #define IMS_TONEBUFFER_H__
37 
38 #include "IMSSystem.h"
39 #include "IEventHandler.h"
40 #include "IMSTypeDefs.h"
41 #include "IBulkTransfer.h"
42 #include "Image.h"
43 #include "FileSystem.h"
44 
45 #include <array>
46 
48 #if defined _WIN32 || defined __CYGWIN__
49  #ifdef __GNUC__
50  #define DLL_EXPORT __attribute__ ((dllexport))
51  #define DLL_IMPORT __attribute__ ((dllimport))
52  #else
53  #define DLL_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
54  #define DLL_IMPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
55  #endif
56  #define DLL_LOCAL
57 #else
58  #if __GNUC__ >= 4
59  #define DLL_EXPORT __attribute__ ((visibility ("default")))
60  #define DLL_IMPORT __attribute__ ((visibility ("default")))
61  #define DLL_LOCAL __attribute__ ((visibility ("hidden")))
62  #else
63  #define DLL_EXPORT
64  #define DLL_IMPORT
65  #define DLL_LOCAL
66  #endif
67 #endif
68 
69 #if defined(_EXPORTING_IMS)
70  #define LIBSPEC DLL_EXPORT
71  #define LIBLOCAL DLL_LOCAL
72  #define EXPIMP_TEMPLATE
73 #elif defined(_STATIC_IMS)
74  #define LIBSPEC
75  #define LIBLOCAL
76  #define EXPIMP_TEMPLATE
77 #else
78  #define LIBSPEC DLL_IMPORT
79  #define LIBLOCAL DLL_LOCAL
80  #define EXPIMP_TEMPLATE extern
81 #endif
82 
84 namespace iMS {
91 
101  class LIBSPEC ToneBufferEvents
102  {
103  public:
105  enum Events {
110  Count
111  };
112  };
113 
122  class LIBSPEC ToneBuffer {
123  public:
128  using TBArray = std::array < TBEntry, 256>;
139 
140  typedef TBArray::iterator iterator;
144  typedef TBArray::const_iterator const_iterator;
146 
150 
151  ToneBuffer(const std::string& name = "");
164  ToneBuffer(const TBEntry& tbe, const std::string& name = "");
174  ToneBuffer(const int entry, const std::string& name = "");
175 
179  ToneBuffer(const ToneBuffer &);
183  ToneBuffer &operator =(const ToneBuffer &);
184 
188  ~ToneBuffer();
190 
191 
195 
196  iterator begin();
212  iterator end();
216  const_iterator begin() const;
220  const_iterator end() const;
224  const_iterator cbegin() const;
228  const_iterator cend() const;
230 
233 
234  const TBEntry& operator[](std::size_t idx) const;
250  TBEntry& operator[](std::size_t idx);
257  bool operator==(ToneBuffer const& rhs) const;
259 
262 
263  const std::size_t Size() const;
270 
274 
275  const std::string& Name() const;
283  std::string& Name();
284  private:
285  class Impl;
286  Impl * p_Impl;
287  };
288 
295  class LIBSPEC ToneBufferDownload : public IBulkTransfer
296  {
297  public:
300 
301  ToneBufferDownload(IMSSystem& ims, const ToneBuffer& tb);
324 
326 
327  bool StartDownload();
333  bool StartDownload(ToneBuffer::const_iterator first, ToneBuffer::const_iterator last);
336  bool StartDownload(ToneBuffer::const_iterator single);
339  bool StartVerify() { return false; };
342  int GetVerifyError() { return -1; };
344 
345 
348 
349  void ToneBufferDownloadEventSubscribe(const int message, IEventHandler* handler);
373  void ToneBufferDownloadEventUnsubscribe(const int message, const IEventHandler* handler);
375 
377 
378  const FileSystemIndex Store(const std::string& FileName, FileDefault def = FileDefault::NON_DEFAULT) const;
396  private:
397  // Makes this object non-copyable
399  const ToneBufferDownload &operator =(const ToneBufferDownload &);
400 
401  class Impl;
402  Impl * p_Impl;
403  };
404 
405 }
406 
407 #undef EXPIMP_TEMPLATE
408 #undef LIBSPEC
409 #endif
bool StartVerify()
No Verify is possible. Always returns false.
Definition: ToneBuffer.h:339
TBArray::const_iterator const_iterator
Const Iterator defined for user readback of internal TBArray.
Definition: ToneBuffer.h:144
Events
List of Events raised by the ToneBuffer Class and ToneBuffer Table Downloader.
Definition: ToneBuffer.h:105
Event raised each time the ToneBufferDownload class registers an error in the download process...
Definition: ToneBuffer.h:109
Provides a mechanism for downloading ToneBuffer's to a Synthesiser's LTB memory.
Definition: ToneBuffer.h:295
Classes for reading, writing and managing the file system built into an iMS Synthesiser.
FileDefault
Default flag tags a file entry for execution at startup (only one per filetype)
Definition: FileSystem.h:141
Interface Specification class for sending large binary data objects to the iMS.
Definition: IBulkTransfer.h:102
int GetVerifyError()
No Verify is possible. Always return -1.
Definition: ToneBuffer.h:342
Non-default is the normal state for most files.
Interface Class for User Application code to receive and process events from the iMS library...
TBArray::iterator iterator
Iterator defined for user manipulation of internal TBArray.
Definition: ToneBuffer.h:141
An object representing the overall configuration of an attached iMS System and permits applications t...
Definition: IMSSystem.h:361
int FileSystemIndex
FileSystemIndex represents the entry number for a particular file in the FileSystemTable.
Definition: FileSystem.h:150
The entire API is encapsulated by the iMS namespace.
Definition: Auxiliary.h:95
An array of 4-channel FAP Tones stored in memory on the Synthesiser.
Definition: ToneBuffer.h:122
Classes for storing sequences of synchronous multi-channel RF drive data.
Classes within this group are used to store information about an iMS System and to Connect / Disconne...
Interface Class for an Event Handler to be defined in User Code and subscribed to library events...
Definition: IEventHandler.h:146
Interface Specification class for sending large binary data objects to the iMS.
All the different types of events that can be triggered by the ToneBuffer and ToneBufferDownload clas...
Definition: ToneBuffer.h:101
Event raised when ToneBufferDownload has confirmed that the iMS Controller received all of the ToneBu...
Definition: ToneBuffer.h:107
Useful Type Definitions for working with iMS Systems.
Stores 4 FAP Triads containing frequency, amplitude and phase data for 4 RF channels.
Definition: Image.h:99