libyui
2.42.5
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Enumerations
Friends
YMacro.cc
1
/*
2
Copyright (C) 2000-2012 Novell, Inc
3
This library is free software; you can redistribute it and/or modify
4
it under the terms of the GNU Lesser General Public License as
5
published by the Free Software Foundation; either version 2.1 of the
6
License, or (at your option) version 3.0 of the License. This library
7
is distributed in the hope that it will be useful, but WITHOUT ANY
8
WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10
License for more details. You should have received a copy of the GNU
11
Lesser General Public License along with this library; if not, write
12
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13
Floor, Boston, MA 02110-1301 USA
14
*/
15
16
17
/*-/
18
19
File: YMacro.cc
20
21
Author: Stefan Hundhammer <sh@suse.de>
22
23
/-*/
24
25
26
#include "YMacro.h"
27
#include "YMacroRecorder.h"
28
#include "YMacroPlayer.h"
29
30
31
YMacroRecorder
* YMacro::_recorder = 0;
32
YMacroPlayer
* YMacro::_player = 0;
33
34
void
YMacro::setRecorder
(
YMacroRecorder
* recorder )
35
{
36
if
( _recorder )
37
delete
_recorder;
38
39
_recorder =
recorder
;
40
}
41
42
43
void
YMacro::setPlayer
(
YMacroPlayer
* player )
44
{
45
if
( _player )
46
delete
_player;
47
48
_player =
player
;
49
}
50
51
52
void
YMacro::record
(
const
std::string & macroFile )
53
{
54
if
( _recorder )
55
_recorder->
record
( macroFile );
56
}
57
58
59
void
YMacro::endRecording
()
60
{
61
if
( _recorder )
62
_recorder->
endRecording
();
63
}
64
65
66
bool
YMacro::recording
()
67
{
68
if
( _recorder )
69
return
_recorder->
recording
();
70
else
71
return
false
;
72
}
73
74
75
void
YMacro::play
(
const
std::string & macroFile )
76
{
77
if
( _player )
78
_player->
play
( macroFile );
79
}
80
81
82
void
YMacro::playNextBlock
()
83
{
84
if
( _player && _player->
playing
() )
85
_player->
playNextBlock
();
86
}
87
88
89
bool
YMacro::playing
()
90
{
91
if
( _player )
92
return
_player->
playing
();
93
else
94
return
false
;
95
}
96
97
98
void
YMacro::deleteRecorder
()
99
{
100
if
( _recorder )
101
delete
_recorder;
102
}
103
104
105
void
YMacro::deletePlayer
()
106
{
107
if
( _player )
108
delete
_player;
109
}
src
YMacro.cc
Generated by
1.8.3