MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / startPlayback

Method startPlayback

Audio/AudioPlayback.cpp:109–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void
110PlaybackWorker::startPlayback()
111{
112 if (this->player == nullptr) {
113 // Reset buffer list
114 this->instance->clear();
115
116 try {
117 #ifdef SIGDIGGER_HAVE_ALSA
118 this->player = new AlsaPlayer(
119 this->device,
120 this->sampRate,
121 this->bufferSize);
122 #elif defined(SIGDIGGER_HAVE_PORTAUDIO)
123 this->player = new PortAudioPlayer(
124 this->device,
125 this->sampRate,
126 this->bufferSize);
127 #else
128 throw std::runtime_error(
129 "Cannot create audio playback object: audio support disabled at compile time");
130 #endif // SIGDIGGER_HAVE_ALSA
131
132 emit ready();
133 } catch (std::runtime_error &e) {
134 this->player = nullptr;
135 emit error(QString::fromStdString(e.what()));
136 }
137 }
138}
139
140void
141PlaybackWorker::stopPlayback()

Callers 1

setSampleRateMethod · 0.95

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected