summaryrefslogtreecommitdiffstats
path: root/khotkeys/kcontrol/voicerecorder.h
blob: 6edb20f37bc088173f0ebc0fb0ea094822037700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/****************************************************************************

 KHotKeys
 
 Copyright (C) 2005 Olivier Goffgart <ogoffart @ kde.org>

 Distributed under the terms of the GNU General Public License version 2.
 
****************************************************************************/

#ifndef VOICE_RECORDER_H
#define VOICE_RECORDER_H

#include <tqframe.h>
#include "ui/voice_input_widget_ui.h"
#include <tqmemarray.h>

#include "sound.h"
class TQMouseEvent;
class  KAudioRecordStream ;
class KArtsServer;
class KTempFile;
class KLibrary;

namespace KHotKeys
{

	class SoundRecorder;
	class Voice_trigger;

class VoiceRecorder : public Voice_input_widget_ui
    {
    TQ_OBJECT

    public:
        VoiceRecorder(const Sound& sound_P, const TQString &voiceId, TQWidget *parent, const char *name);
        ~VoiceRecorder();

        Sound sound() const;
		
        enum State { sNotModified , sIncorrect, sModified  };

        inline State state() const
            {
            return _state;
            }
            
        static bool init( KLibrary* lib );
        typedef void (*arts_play_fun)( const TQString& file );

    protected slots:
        void slotStopPressed();
        void slotRecordPressed();
        void slotPlayPressed();

    signals:
        void recorded(bool);
	private slots:
        void slotSoundRecorded(const Sound& sound);
        bool drawSound();

    private:
        SoundRecorder *_recorder;
        Sound _sound;
        State _state;
        KTempFile *_tempFile;
        TQString _voiceId;
        static arts_play_fun arts_play;
    };

} // namespace KHotKeys

#endif