CLAM-Development  1.4.0
PortMonitor.cxx
Go to the documentation of this file.
1 #include "PortMonitor.hxx"
2 #include "ProcessingFactory.hxx"
3 
4 namespace CLAM
5 {
6 
7  template <>
9  {
10  if(!AbleToExecute()) return true;
11  unsigned whichDataToWrite = mWhichDataToRead?0:1;
12  mData[whichDataToWrite] = mInput.GetAudio();
13  mSigNewData.Emit();
14  {
15  TryMutex::ScopedTryLock lock(mSwitchMutex,true);
16  if (lock.Locked())
17  mWhichDataToRead = whichDataToWrite;
18  }
19  mInput.Consume();
20  return true;
21  }
22 
23  template <>
25  : mInput("Input", this)
26  , mWhichDataToRead(0)
27  {
28  Configure(cfg);
29  }
30 #ifndef QT_PLUGIN
31  static const char * metadataPeaks[] = {
32  "key", "PeaksPortMonitor",
33  // "category", "Monitors",
34  // "description", "PeaksPortMonitor",
35  0
36  };
38 
39  static const char * metadataSpectrum[] = {
40  "key", "SpectrumPortMonitor",
41  // "category", "Monitors",
42  // "description", "SpectrumPortMonitor",
43  0
44  };
46 
47  static const char * metadataAudio[] = {
48  "key", "AudioPortMonitor",
49  // "category", "Monitors",
50  // "description", "AudioPortMonitor",
51  0
52  };
54 
55  static const char * metadataFundamental[] = {
56  "key", "FundamentalPortMonitor",
57  // "category", "Monitors",
58  // "description", "FundamentalPortMonitor",
59  0
60  };
62 
63  static const char * metadataAudioBuff[] = {
64  "key", "AudioBuffPortMonitor",
65  // "category", "Monitors",
66  // "description", "AudioBuffPortMonitor",
67  0
68  };
70 
71  static const char * metadataSpecgram[] = {
72  "key", "SpecgramPortMonitor",
73  // "category", "Monitors",
74  // "description", "SpecgramPortMonitor",
75  0
76  };
78 
79  static const char * metadataFundTrack[] = {
80  "key", "FundTrackPortMonitor",
81  // "category", "Monitors",
82  // "description", "FundTrackPortMonitor",
83  0
84  };
86 
87  static const char * metadataSinTracks[] = {
88  "key", "SinTracksPortMonitor",
89  // "category", "Monitors",
90  // "description", "SinTracksPortMonitor",
91  0
92  };
94 #endif
95 
96 } // namespace CLAM
97