diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-22 18:23:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-22 18:23:26 +0000 |
commit | ae364d9bed0589bf1a22cd5f530c563462379e3e (patch) | |
tree | e32727e2664e7ce68d0d30270afa040320ae35a1 /kradio3/plugins/v4lradio/v4lcfg_interfaces.cpp | |
download | tderadio-ae364d9bed0589bf1a22cd5f530c563462379e3e.tar.gz tderadio-ae364d9bed0589bf1a22cd5f530c563462379e3e.zip |
Added old KDE3 version of kradio
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1094417 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kradio3/plugins/v4lradio/v4lcfg_interfaces.cpp')
-rw-r--r-- | kradio3/plugins/v4lradio/v4lcfg_interfaces.cpp | 193 |
1 files changed, 193 insertions, 0 deletions
diff --git a/kradio3/plugins/v4lradio/v4lcfg_interfaces.cpp b/kradio3/plugins/v4lradio/v4lcfg_interfaces.cpp new file mode 100644 index 0000000..c679c76 --- /dev/null +++ b/kradio3/plugins/v4lradio/v4lcfg_interfaces.cpp @@ -0,0 +1,193 @@ +/*************************************************************************** + v4lradio_interfaces.cpp - description + ------------------- + begin : Sam Jun 21 2003 + copyright : (C) 2003 by Martin Witte + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 "v4lcfg_interfaces.h" + +/////////////////////////////////////////////////////////////////////// + +V4LCaps::V4LCaps() + : version(0), + description(QString::null), + hasMute(false), + hasVolume(false), + minVolume(0), + maxVolume(65535), + hasTreble(false), + minTreble(0), + maxTreble(65535), + hasBass(false), + minBass(0), + maxBass(65535), + hasBalance(false), + minBalance(0), + maxBalance(65535) +{ +} + + +V4LCaps::V4LCaps(const V4LCaps &c) + : version(c.version), + description(c.description), + hasMute(c.hasMute), + hasVolume(c.hasVolume), + minVolume(c.minVolume), + maxVolume(c.maxVolume), + hasTreble(c.hasTreble), + minTreble(c.minTreble), + maxTreble(c.maxTreble), + hasBass(c.hasBass), + minBass(c.minBass), + maxBass(c.maxBass), + hasBalance(c.hasBalance), + minBalance(c.minBalance), + maxBalance(c.maxBalance) +{ +} + + +// IV4LCfg + +IF_IMPL_SENDER ( IV4LCfg::notifyRadioDeviceChanged(const QString &s), + noticeRadioDeviceChanged(s) + ) +IF_IMPL_SENDER ( IV4LCfg::notifyPlaybackMixerChanged(const QString &s, const QString &Channel), + noticePlaybackMixerChanged(s, Channel) + ) +IF_IMPL_SENDER ( IV4LCfg::notifyCaptureMixerChanged(const QString &s, const QString &Channel), + noticeCaptureMixerChanged(s, Channel) + ) +IF_IMPL_SENDER ( IV4LCfg::notifyDeviceVolumeChanged(float v), + noticeDeviceVolumeChanged(v) + ) +IF_IMPL_SENDER ( IV4LCfg::notifyCapabilitiesChanged(const V4LCaps &c), + noticeCapabilitiesChanged(c) + ) + +IF_IMPL_SENDER ( IV4LCfg::notifyActivePlaybackChanged(bool a), + noticeActivePlaybackChanged(a) + ) + +IF_IMPL_SENDER ( IV4LCfg::notifyMuteOnPowerOffChanged(bool a), + noticeMuteOnPowerOffChanged(a) + ) + +IF_IMPL_SENDER ( IV4LCfg::notifyVolumeZeroOnPowerOffChanged(bool a), + noticeVolumeZeroOnPowerOffChanged(a) + ) +// IV4LCfgClient + +IF_IMPL_SENDER ( IV4LCfgClient::sendRadioDevice (const QString &s), + setRadioDevice(s) + ) +IF_IMPL_SENDER ( IV4LCfgClient::sendPlaybackMixer(const QString &s, const QString &ch), + setPlaybackMixer(s, ch) + ) +IF_IMPL_SENDER ( IV4LCfgClient::sendCaptureMixer(const QString &s, const QString &ch), + setCaptureMixer(s, ch) + ) +IF_IMPL_SENDER ( IV4LCfgClient::sendDeviceVolume(float v), + setDeviceVolume(v) + ) + +IF_IMPL_SENDER ( IV4LCfgClient::sendActivePlayback(bool a), + setActivePlayback(a) + ) + +IF_IMPL_SENDER ( IV4LCfgClient::sendMuteOnPowerOff(bool a), + setMuteOnPowerOff(a) + ) + +IF_IMPL_SENDER ( IV4LCfgClient::sendVolumeZeroOnPowerOff(bool a), + setVolumeZeroOnPowerOff(a) + ) + +static QString defaultRDev("/dev/radio"); +// static QString defaultMDev("/dev/mixer"); + +IF_IMPL_QUERY ( const QString &IV4LCfgClient::queryRadioDevice (), + getRadioDevice(), + defaultRDev + ) +IF_IMPL_QUERY ( const QString &IV4LCfgClient::queryPlaybackMixerID (), + getPlaybackMixerID(), + QString::null + ) +IF_IMPL_QUERY ( const QString &IV4LCfgClient::queryCaptureMixerID (), + getCaptureMixerID(), + QString::null + ) + +static const QString channel_line("Line"); +IF_IMPL_QUERY ( const QString &IV4LCfgClient::queryPlaybackMixerChannel(), + getPlaybackMixerChannel(), + channel_line + ) +IF_IMPL_QUERY ( const QString &IV4LCfgClient::queryCaptureMixerChannel(), + getCaptureMixerChannel(), + channel_line + ) +IF_IMPL_QUERY ( float IV4LCfgClient::queryDeviceVolume (), + getDeviceVolume(), + 0.0 + ) +IF_IMPL_QUERY ( V4LCaps IV4LCfgClient::queryCapabilities(QString dev), + getCapabilities(dev), + V4LCaps() + ) + +IF_IMPL_QUERY ( bool IV4LCfgClient::queryActivePlayback(), + getActivePlayback(), + false + ) + +IF_IMPL_QUERY ( bool IV4LCfgClient::queryMuteOnPowerOff(), + getMuteOnPowerOff(), + false + ) + +IF_IMPL_QUERY ( bool IV4LCfgClient::queryVolumeZeroOnPowerOff(), + getVolumeZeroOnPowerOff(), + false + ) + +void IV4LCfgClient::noticeConnectedI (cmplInterface *, bool /*pointer_valid*/) +{ + noticeRadioDeviceChanged(queryRadioDevice()); + noticePlaybackMixerChanged(queryPlaybackMixerID(), queryPlaybackMixerChannel()); + noticeCaptureMixerChanged (queryCaptureMixerID(), queryCaptureMixerChannel()); + noticeDeviceVolumeChanged(queryDeviceVolume()); + noticeCapabilitiesChanged(queryCapabilities()); + noticeActivePlaybackChanged(queryActivePlayback()); + noticeMuteOnPowerOffChanged(queryMuteOnPowerOff()); + noticeVolumeZeroOnPowerOffChanged(queryVolumeZeroOnPowerOff()); +} + + +void IV4LCfgClient::noticeDisconnectedI (cmplInterface *, bool /*pointer_valid*/) +{ + noticeRadioDeviceChanged(queryRadioDevice()); + noticePlaybackMixerChanged(queryPlaybackMixerID(), queryPlaybackMixerChannel()); + noticeCaptureMixerChanged (queryCaptureMixerID(), queryCaptureMixerChannel()); + noticeDeviceVolumeChanged(queryDeviceVolume()); + noticeCapabilitiesChanged(queryCapabilities()); + noticeActivePlaybackChanged(queryActivePlayback()); + noticeMuteOnPowerOffChanged(queryMuteOnPowerOff()); + noticeVolumeZeroOnPowerOffChanged(queryVolumeZeroOnPowerOff()); +} + + |