1
// NullSoundHandler - fake sound handler, for testing gnash
3
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 3 of the License, or
8
// (at your option) any later version.
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with this program; if not, write to the Free Software
17
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef NULL_SOUND_HANDLER_H
21
#define NULL_SOUND_HANDLER_H
24
#include "gnashconfig.h"
27
#include "sound_handler.h" // for inheritance
28
#include "dsodefs.h" // for DSOEXPORT
39
/// Null Sound handler, for testing
40
class DSOEXPORT NullSoundHandler : public sound_handler
44
// See dox in sound_handler.h
45
virtual int create_sound(
46
std::auto_ptr<SimpleBuffer> /*data*/,
47
std::auto_ptr<SoundInfo> /*sinfo*/
53
// See dox in sound_handler.h
55
virtual long fill_stream_data(unsigned char* /*data*/, unsigned int /*data_bytes*/, unsigned int /*sample_count*/, int /*handle_id*/)
60
// See dox in sound_handler.h
61
virtual SoundInfo* get_sound_info(int /*sound_handle*/) { return 0; }
63
// See dox in sound_handler.h
64
virtual void play_sound(int /*sound_handle*/, int /*loop_count*/, int /*secondOffset*/, long /*start*/,
65
const std::vector<sound_envelope>* /*envelopes*/)
69
// See dox in sound_handler.h
70
virtual void stop_all_sounds() {}
72
// See dox in sound_handler.h
73
// TODO: implement here
74
virtual int get_volume(int /*sound_handle*/) { return 0; }
76
// See dox in sound_handler.h
77
// TODO: implement here
78
virtual void set_volume(int /*sound_handle*/, int /*volume*/) {}
80
// See dox in sound_handler.h
81
virtual void stop_sound(int /*sound_handle*/) {}
83
// See dox in sound_handler.h
84
virtual void delete_sound(int /*sound_handle*/) {}
86
// See dox in sound_handler.h
87
virtual void reset() {}
89
// See dox in sound_handler.h (why is this virtual anyway ?)
90
virtual void mute() {}
92
// See dox in sound_handler.h (why is this virtual anyway ?)
93
virtual void unmute() {}
95
// See dox in sound_handler.h (why is this virtual anyway ?)
96
virtual bool is_muted() { return false; }
99
// See dox in sound_handler.h
100
virtual void attach_aux_streamer(aux_streamer_ptr /*ptr*/, void* /*owner*/) {}
102
// See dox in sound_handler.h
103
virtual void detach_aux_streamer(void* /*udata*/) {}
106
// See dox in sound_handler.h
107
virtual unsigned int get_duration(int /*sound_handle*/) { return 0; }
109
// See dox in sound_handler.h
110
virtual unsigned int tell(int /*sound_handle*/) { return 0; }
114
} // gnash.media namespace
117
#endif // NULL_SOUND_HANDLER_H
122
// indent-tabs-mode: t