You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
152 lines
6.0 KiB
152 lines
6.0 KiB
15 years ago
|
/***************************************************************************
|
||
|
reccfg_interfaces.cpp - description
|
||
|
-------------------
|
||
|
begin : Sun May 01 2005
|
||
|
copyright : (C) 2005by Martin Witte
|
||
|
email : witte@kawo1.rwth-aachen.de
|
||
|
***************************************************************************/
|
||
|
|
||
|
/***************************************************************************
|
||
|
* *
|
||
|
* This program is free software; you can redistribute it and/or modify *
|
||
|
* it under the terms of the GNU General Public License as published by *
|
||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||
|
* (at your option) any later version. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
|
#include <linux/soundcard.h>
|
||
|
#include "reccfg_interfaces.h"
|
||
|
|
||
|
// IRecCfg
|
||
|
|
||
|
IF_IMPL_SENDER ( IRecCfg::notifyEncoderBufferChanged (size_t BufferSize, size_t BufferCount),
|
||
|
noticeEncoderBufferChanged(BufferSize, BufferCount)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfg::notifySoundFormatChanged(const SoundFormat &sf),
|
||
|
noticeSoundFormatChanged(sf)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfg::notifyMP3QualityChanged(int q),
|
||
|
noticeMP3QualityChanged(q)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfg::notifyOggQualityChanged(float q),
|
||
|
noticeOggQualityChanged(q)
|
||
|
);
|
||
14 years ago
|
IF_IMPL_SENDER ( IRecCfg::notifyRecordingDirectoryChanged(const TQString &dir),
|
||
15 years ago
|
noticeRecordingDirectoryChanged(dir)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfg::notifyOutputFormatChanged(RecordingConfig::OutputFormat of),
|
||
|
noticeOutputFormatChanged(of)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfg::notifyPreRecordingChanged(bool enable, int seconds),
|
||
|
noticePreRecordingChanged(enable, seconds)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfg::notifyRecordingConfigChanged (const RecordingConfig &cfg),
|
||
|
noticeRecordingConfigChanged(cfg)
|
||
|
);
|
||
|
|
||
|
// IRecCfgClient
|
||
|
|
||
|
IF_IMPL_SENDER ( IRecCfgClient::sendEncoderBuffer (size_t BufferSize, size_t BufferCount),
|
||
|
setEncoderBuffer(BufferSize, BufferCount)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfgClient::sendSoundFormat(const SoundFormat &sf),
|
||
|
setSoundFormat(sf)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfgClient::sendMP3Quality(int q),
|
||
|
setMP3Quality(q)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfgClient::sendOggQuality(float q),
|
||
|
setOggQuality(q)
|
||
|
);
|
||
14 years ago
|
IF_IMPL_SENDER ( IRecCfgClient::sendRecordingDirectory(const TQString &dir),
|
||
15 years ago
|
setRecordingDirectory(dir)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfgClient::sendOutputFormat(RecordingConfig::OutputFormat of),
|
||
|
setOutputFormat(of)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfgClient::sendPreRecording(bool enable, int seconds),
|
||
|
setPreRecording(enable, seconds)
|
||
|
);
|
||
|
IF_IMPL_SENDER ( IRecCfgClient::sendRecordingConfig(const RecordingConfig &cfg),
|
||
|
setRecordingConfig(cfg)
|
||
|
);
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( void IRecCfgClient::queryEncoderBuffer(size_t &BufferSize, size_t &BufferCount),
|
||
15 years ago
|
getEncoderBuffer(BufferSize, BufferCount),
|
||
|
|
||
|
);
|
||
|
|
||
|
static SoundFormat defaultSoundFormat;
|
||
13 years ago
|
IF_IMPL_QUERY ( const SoundFormat &IRecCfgClient::querySoundFormat (),
|
||
15 years ago
|
getSoundFormat(),
|
||
|
defaultSoundFormat
|
||
|
);
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( int IRecCfgClient::queryMP3Quality (),
|
||
15 years ago
|
getMP3Quality(),
|
||
|
7
|
||
|
);
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( float IRecCfgClient::queryOggQuality (),
|
||
15 years ago
|
getOggQuality(),
|
||
|
7
|
||
|
);
|
||
|
|
||
14 years ago
|
static TQString defaultRecDir("/tmp");
|
||
13 years ago
|
IF_IMPL_QUERY ( const TQString &IRecCfgClient::queryRecordingDirectory(),
|
||
15 years ago
|
getRecordingDirectory(),
|
||
|
defaultRecDir
|
||
|
);
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( RecordingConfig::OutputFormat IRecCfgClient::queryOutputFormat(),
|
||
15 years ago
|
getOutputFormat(),
|
||
|
RecordingConfig::outputWAV
|
||
|
);
|
||
|
|
||
13 years ago
|
IF_IMPL_QUERY ( bool IRecCfgClient::queryPreRecording(int &seconds),
|
||
15 years ago
|
getPreRecording(seconds),
|
||
|
false
|
||
|
);
|
||
|
|
||
|
static RecordingConfig defaultRecConfig;
|
||
13 years ago
|
IF_IMPL_QUERY ( const RecordingConfig &IRecCfgClient::queryRecordingConfig(),
|
||
15 years ago
|
getRecordingConfig(),
|
||
|
defaultRecConfig
|
||
|
);
|
||
|
|
||
|
void IRecCfgClient::noticeConnectedI (cmplInterface *, bool /*pointer_valid*/)
|
||
|
{
|
||
|
size_t bs = 0, bc = 0;
|
||
|
queryEncoderBuffer(bs, bc);
|
||
|
noticeEncoderBufferChanged(bs, bc);
|
||
|
noticeSoundFormatChanged(querySoundFormat());
|
||
|
noticeMP3QualityChanged (queryMP3Quality());
|
||
|
noticeOggQualityChanged (queryOggQuality());
|
||
|
noticeRecordingDirectoryChanged(queryRecordingDirectory());
|
||
|
noticeOutputFormatChanged(queryOutputFormat());
|
||
|
int s = 0;
|
||
|
bool e = queryPreRecording(s);
|
||
|
noticePreRecordingChanged(e, s);
|
||
|
noticeRecordingConfigChanged(queryRecordingConfig());
|
||
|
}
|
||
|
|
||
|
|
||
|
void IRecCfgClient::noticeDisconnectedI (cmplInterface *, bool /*pointer_valid*/)
|
||
|
{
|
||
|
size_t bs = 0, bc = 0;
|
||
|
queryEncoderBuffer(bs, bc);
|
||
|
noticeEncoderBufferChanged(bs, bc);
|
||
|
noticeSoundFormatChanged(querySoundFormat());
|
||
|
noticeMP3QualityChanged (queryMP3Quality());
|
||
|
noticeOggQualityChanged (queryOggQuality());
|
||
|
noticeRecordingDirectoryChanged(queryRecordingDirectory());
|
||
|
noticeOutputFormatChanged(queryOutputFormat());
|
||
|
int s = 0;
|
||
|
bool e = queryPreRecording(s);
|
||
|
noticePreRecordingChanged(e, s);
|
||
|
noticeRecordingConfigChanged(queryRecordingConfig());
|
||
|
}
|
||
|
|
||
|
|