Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
IMSSystem.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2 / Title : IMS System Definitions Header
3 / Project : Isomet Modular Synthesiser System
4 /------------------------------------------------------------------------------
5 / File : $URL: http://nutmeg.qytek.lan/svn/sw/trunk/09-Isomet/iMS_SDK/API/ConnectionManager/h/IMSSystem.h $
6 / Author : $Author: dave $
7 / Company : Isomet (UK) Ltd
8 / Created : 2015-04-09
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) 2015 Isomet (UK) Ltd. All Rights Reserved.
17 /------------------------------------------------------------------------------
18 / Revisions :
19 / Date Version Author Description
20 / 2015-04-09 1.0 dc Created
21 /
22 /----------------------------------------------------------------------------*/
23 
60 
61 #ifndef IMS_IMSSYSTEM_H__
62 #define IMS_IMSSYSTEM_H__
63 
64 #include "IMSTypeDefs.h"
65 
66 #include <ctime>
67 #include <string>
68 
70 #if defined _WIN32 || defined __CYGWIN__
71  #ifdef __GNUC__
72  #define DLL_EXPORT __attribute__ ((dllexport))
73  #define DLL_IMPORT __attribute__ ((dllimport))
74  #else
75  #define DLL_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
76  #define DLL_IMPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
77  #endif
78  #define DLL_LOCAL
79 #else
80  #if __GNUC__ >= 4
81  #define DLL_EXPORT __attribute__ ((visibility ("default")))
82  #define DLL_IMPORT __attribute__ ((visibility ("default")))
83  #define DLL_LOCAL __attribute__ ((visibility ("hidden")))
84  #else
85  #define DLL_EXPORT
86  #define DLL_IMPORT
87  #define DLL_LOCAL
88  #endif
89 #endif
90 
91 #if defined(_EXPORTING_IMS)
92  #define LIBSPEC DLL_EXPORT
93  #define LIBLOCAL DLL_LOCAL
94  #define EXPIMP_TEMPLATE
95 #elif defined(_STATIC_IMS)
96  #define LIBSPEC
97  #define LIBLOCAL
98  #define EXPIMP_TEMPLATE
99 #else
100  #define LIBSPEC DLL_IMPORT
101  #define LIBLOCAL DLL_LOCAL
102  #define EXPIMP_TEMPLATE extern
103 #endif
104 
106 namespace iMS
107 {
108  // Forward declaration required to allow IMSSystem class to know of the existence of a connection to the iMS
109  class IConnectionManager;
110 
111  // Forward declaration required to allow IMSSystem class to know of the existence of a Synthesiser File System
112  class FileSystemTable;
113 
114  // Forward declaration required to allow IMSSystem class to know of the existence of a Controller Image Table
115  class ImageTable;
116 
131  class IMSOption
132  {
133  public:
134  IMSOption();
135  ~IMSOption();
136  };
137 
153  struct LIBSPEC FWVersion
154  {
156  int major{ -1 };
158  int minor{ 0 };
160  int revision{ 0 };
162  struct std::tm build_date;
163 
166  FWVersion();
167  FWVersion(const std::vector<std::uint16_t>&);
169 
180  friend LIBSPEC std::ostream& operator<< (std::ostream& stream, const FWVersion&);
181  };
182 
199  class LIBSPEC IMSController
200  {
201  public:
202 
213  struct LIBSPEC Capabilities
214  {
216  int nSynthInterfaces{ 1 };
218  bool FastImageTransfer{ false };
220  int MaxImageSize{ 4096 };
222  bool SimultaneousPlayback{ false };
224  Frequency MaxImageRate{ 250.0 };
225  };
228  IMSController();
229  IMSController(const std::string&, const std::string&, const Capabilities&, const FWVersion&, const ImageTable&);
230  ~IMSController();
231 
232  // Copy & Assignment Constructors
233  IMSController(const IMSController &);
234  IMSController &operator =(const IMSController &);
236 
239  const Capabilities GetCap() const;
242  const std::string& Description() const;
245  const std::string& Model() const;
248  const FWVersion& GetVersion() const;
251  const ImageTable& ImgTable() const;
255  const bool IsValid() const;
256  private:
257  class Impl;
258  Impl * p_Impl;
259  };
260 
277  class LIBSPEC IMSSynthesiser
278  {
279  public:
280 
291  struct LIBSPEC Capabilities
292  {
294  MHz lowerFrequency{ 0.0 };
296  MHz upperFrequency{ 250.0 };
298  int freqBits{ 16 };
300  int amplBits{ 10 };
302  int phaseBits{ 12 };
304  int LUTDepth{ 12 };
306  int LUTAmplBits{ 12 };
308  int LUTPhaseBits{ 14 };
310  int LUTSyncABits{ 12 };
312  int LUTSyncDBits{ 12 };
313  };
314 
316  IMSSynthesiser();
317  IMSSynthesiser(const std::string&, const std::string&, const Capabilities&, const FWVersion&, const FileSystemTable&);
318  ~IMSSynthesiser();
319 
320  // Copy & Assignment Constructors
322  IMSSynthesiser &operator =(const IMSSynthesiser &);
324 
329  const Capabilities GetCap() const;
332  const std::string& Description() const;
335  const std::string& Model() const;
338  const FWVersion& GetVersion() const;
342  const bool IsValid() const;
345  const FileSystemTable& FST() const;
346 
347  private:
348  class Impl;
349  Impl * p_Impl;
350  };
351 
361  class LIBSPEC IMSSystem
362  {
363  public:
365  IMSSystem();
366  IMSSystem(IConnectionManager* const, const std::string&);
367  ~IMSSystem();
368 
369  // Copy & Assignment Constructors
370  IMSSystem(const IMSSystem &);
371  IMSSystem &operator =(const IMSSystem &);
372 
374  bool Initialise();
376 
379 
380  void Connect();
396  void Disconnect();
401  bool Open() const;
403 
406  IConnectionManager* const Connection() const;
407 
410  void Ctlr(const IMSController&);
413  void Synth(const IMSSynthesiser&);
417  const IMSController& Ctlr() const;
421  const IMSSynthesiser& Synth() const;
422 
425  const std::string& ConnPort() const;
426 
429  bool operator==(IMSSystem const& rhs) const;
430 
431  private:
432  class Impl;
433  Impl * p_Impl;
434  };
435 
436 }
437 
438 #undef EXPIMP_TEMPLATE
439 #undef LIBSPEC
440 #endif
Stores the version number of firmware running on iMS hardware.
Definition: IMSSystem.h:153
Returns information about the capabilities of the Synthesiser hardware.
Definition: IMSSystem.h:291
An object representing the overall configuration of an attached iMS System and permits applications t...
Definition: IMSSystem.h:361
Stores Capabilities, Description, Model & Version Number of an iMS Synthesiser.
Definition: IMSSystem.h:277
The entire API is encapsulated by the iMS namespace.
Definition: Auxiliary.h:95
IMSOption * AddOn
If there are any Options attached to the Synthesiser, these are accessed here, else a null pointer is...
Definition: IMSSystem.h:326
Type Definition for all operations that require a frequency specification in MegaHertz.
Definition: IMSTypeDefs.h:191
Returns information about the capabilities of the Controller hardware.
Definition: IMSSystem.h:213
Stores Capabilities, Description, Model & Version Number of an iMS Controller.
Definition: IMSSystem.h:199
An iMS Synthesiser can support one iMS Option, which adds an additional hardware function to the capa...
Definition: IMSSystem.h:131
Useful Type Definitions for working with iMS Systems.
Type Definition for all operations that require a frequency specification.
Definition: IMSTypeDefs.h:96