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.
122 lines
4.3 KiB
122 lines
4.3 KiB
15 years ago
|
/***************************************************************************
|
||
|
timeshifter.h - description
|
||
|
-------------------
|
||
|
begin : May 16 2005
|
||
|
copyright : (C) 2005 Ernst 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. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
|
#ifndef KRADIO_TIMESHIFTER_H
|
||
|
#define KRADIO_TIMESHIFTER_H
|
||
|
|
||
|
#ifdef HAVE_CONFIG_H
|
||
|
#include <config.h>
|
||
|
#endif
|
||
|
|
||
|
#include "../../src/include/plugins.h"
|
||
|
#include "../../src/include/soundstreamclient_interfaces.h"
|
||
|
#include "../../src/include/fileringbuffer.h"
|
||
|
|
||
|
|
||
14 years ago
|
class TimeShifter : public TQObject,
|
||
15 years ago
|
public PluginBase,
|
||
|
public ISoundStreamClient
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
14 years ago
|
TimeShifter (const TQString &name);
|
||
15 years ago
|
virtual ~TimeShifter ();
|
||
|
|
||
|
virtual bool connectI (Interface *);
|
||
|
virtual bool disconnectI (Interface *);
|
||
|
|
||
14 years ago
|
virtual TQString pluginClassName() const { return "TimeShifter"; }
|
||
15 years ago
|
|
||
14 years ago
|
virtual const TQString &name() const { return PluginBase::name(); }
|
||
|
virtual TQString &name() { return PluginBase::name(); }
|
||
15 years ago
|
|
||
|
// config
|
||
|
|
||
14 years ago
|
const TQString &getPlaybackMixer() const { return m_PlaybackMixerID; }
|
||
|
const TQString &getPlaybackMixerChannel() const { return m_PlaybackMixerChannel; }
|
||
|
const TQString &getTempFileName() const { return m_TempFileName; }
|
||
|
TQ_UINT64 getTempFileMaxSize() const { return m_TempFileMaxSize; }
|
||
15 years ago
|
|
||
14 years ago
|
void setTempFile(const TQString &filename, TQ_UINT64 s);
|
||
|
bool setPlaybackMixer(const TQString &soundStreamClientID, const TQString &ch);
|
||
15 years ago
|
|
||
|
// PluginBase
|
||
|
|
||
|
public:
|
||
12 years ago
|
virtual void saveState (TDEConfig *) const;
|
||
|
virtual void restoreState (TDEConfig *);
|
||
15 years ago
|
|
||
|
virtual ConfigPageInfo createConfigurationPage();
|
||
|
virtual AboutPageInfo createAboutPage();
|
||
|
|
||
|
protected:
|
||
|
|
||
|
ISoundStreamClient *searchPlaybackMixer();
|
||
|
|
||
|
size_t writeMetaDataToBuffer(const SoundMetaData &md, char *buffer, size_t buffer_size);
|
||
|
size_t readMetaDataFromBuffer(SoundMetaData &md, const char *buffer, size_t buffer_size);
|
||
|
void skipPacketInRingBuffer();
|
||
|
|
||
|
// SoundStreamClient
|
||
|
void noticeConnectedI (ISoundStreamServer *s, bool pointer_valid);
|
||
|
|
||
|
bool startCaptureWithFormat(SoundStreamID id,
|
||
|
const SoundFormat &proposed_format,
|
||
|
SoundFormat &real_format,
|
||
|
bool force_format);
|
||
|
bool stopCapture(SoundStreamID id);
|
||
|
bool noticeSoundStreamClosed(SoundStreamID id);
|
||
|
bool startPlayback(SoundStreamID id);
|
||
|
bool stopPlayback(SoundStreamID id);
|
||
|
bool pausePlayback(SoundStreamID id);
|
||
|
bool noticeSoundStreamData(SoundStreamID id, const SoundFormat &sf, const char *data, size_t size, size_t &consumed_size, const SoundMetaData &md);
|
||
|
bool noticeReadyForPlaybackData(SoundStreamID id, size_t size);
|
||
|
|
||
14 years ago
|
bool getSoundStreamDescription(SoundStreamID id, TQString &descr) const;
|
||
15 years ago
|
|
||
|
// FIXME: react on redirect request
|
||
|
|
||
|
signals:
|
||
|
|
||
|
void sigUpdateConfig();
|
||
|
|
||
|
protected:
|
||
|
|
||
14 years ago
|
TQString m_TempFileName;
|
||
15 years ago
|
size_t m_TempFileMaxSize;
|
||
|
SoundFormat m_SoundFormat;
|
||
|
SoundFormat m_realSoundFormat;
|
||
|
|
||
14 years ago
|
TQString m_PlaybackMixerID;
|
||
|
TQString m_PlaybackMixerChannel;
|
||
15 years ago
|
|
||
14 years ago
|
TQString m_StreamFile;
|
||
15 years ago
|
bool m_StreamPaused;
|
||
|
SoundStreamID m_OrgStreamID;
|
||
|
SoundStreamID m_NewStreamID;
|
||
|
SoundFormat m_RealSoundFormat;
|
||
|
float m_orgVolume;
|
||
|
|
||
|
SoundMetaData m_PlaybackMetaData;
|
||
|
size_t m_PlaybackDataLeftInBuffer;
|
||
|
|
||
|
FileRingBuffer m_RingBuffer;
|
||
|
};
|
||
|
|
||
|
#endif
|