~ubuntu-branches/debian/squeeze/stella/squeeze

« back to all changes in this revision

Viewing changes to src/common/SoundNull.hxx

  • Committer: Bazaar Package Importer
  • Author(s): Mario Iseli
  • Date: 2006-04-08 18:38:25 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060408183825-vu1jk57rk929derx
* New Maintainer (Closes: #361345)
* New upstream release (Closes: #349725)
* Build-Depend now on libslang2-dev (Closes: #325577)
* Complete rebuild of debian/, upgraded to policy-standards
  3.6.2 and compat-level 5.
* Removed stellarc since stella only reads ~/.stellarc and even
  works without a first config.
* New debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//============================================================================
 
2
//
 
3
//   SSSS    tt          lll  lll       
 
4
//  SS  SS   tt           ll   ll        
 
5
//  SS     tttttt  eeee   ll   ll   aaaa 
 
6
//   SSSS    tt   ee  ee  ll   ll      aa
 
7
//      SS   tt   eeeeee  ll   ll   aaaaa  --  "An Atari 2600 VCS Emulator"
 
8
//  SS  SS   tt   ee      ll   ll  aa  aa
 
9
//   SSSS     ttt  eeeee llll llll  aaaaa
 
10
//
 
11
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
 
12
//
 
13
// See the file "license" for information on usage and redistribution of
 
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
 
15
//
 
16
// $Id: SoundNull.hxx,v 1.4 2005/09/10 16:19:20 bwmott Exp $
 
17
//============================================================================
 
18
 
 
19
#ifndef SOUND_NULL_HXX
 
20
#define SOUND_NULL_HXX
 
21
 
 
22
class OSystem;
 
23
class Serializer;
 
24
class Deserializer;
 
25
 
 
26
#include "bspf.hxx"
 
27
#include "Sound.hxx"
 
28
 
 
29
/**
 
30
  This class implements a Null sound object, where-by sound generation
 
31
  is completely disabled.
 
32
 
 
33
  @author Stephen Anthony
 
34
  @version $Id: SoundNull.hxx,v 1.4 2005/09/10 16:19:20 bwmott Exp $
 
35
*/
 
36
class SoundNull : public Sound
 
37
{
 
38
  public:
 
39
    /**
 
40
      Create a new sound object.  The init method must be invoked before
 
41
      using the object.
 
42
    */
 
43
    SoundNull(OSystem* osystem);
 
44
 
 
45
    /**
 
46
      Destructor
 
47
    */
 
48
    virtual ~SoundNull();
 
49
 
 
50
  public: 
 
51
    /**
 
52
      Enables/disables the sound subsystem.
 
53
 
 
54
      @param enable  Either true or false, to enable or disable the sound system
 
55
      @return        Whether the sound system was enabled or disabled
 
56
    */
 
57
    void setEnabled(bool enable) { }
 
58
 
 
59
    /**
 
60
      The system cycle counter is being adjusting by the specified amount.  Any
 
61
      members using the system cycle counter should be adjusted as needed.
 
62
 
 
63
      @param amount The amount the cycle counter is being adjusted by
 
64
    */
 
65
    void adjustCycleCounter(Int32 amount) { }
 
66
 
 
67
    /**
 
68
      Sets the number of channels (mono or stereo sound).
 
69
 
 
70
      @param channels The number of channels
 
71
    */
 
72
    void setChannels(uInt32 channels) { }
 
73
 
 
74
    /**
 
75
      Sets the display framerate.  Sound generation for NTSC and PAL games
 
76
      depends on the framerate, so we need to set it here.
 
77
 
 
78
      @param framerate The base framerate depending on NTSC or PAL ROM
 
79
    */
 
80
    void setFrameRate(uInt32 framerate) { }
 
81
 
 
82
    /**
 
83
      Initializes the sound device.  This must be called before any
 
84
      calls are made to derived methods.
 
85
    */
 
86
    void initialize() { }
 
87
 
 
88
    /**
 
89
      Should be called to close the sound device.  Once called the sound
 
90
      device can be started again using the initialize method.
 
91
    */
 
92
    void close() { }
 
93
 
 
94
    /**
 
95
      Return true iff the sound device was successfully initialized.
 
96
 
 
97
      @return true iff the sound device was successfully initialized.
 
98
    */
 
99
    bool isSuccessfullyInitialized() const { return false; }
 
100
 
 
101
    /**
 
102
      Set the mute state of the sound object.  While muted no sound is played.
 
103
 
 
104
      @param state Mutes sound if true, unmute if false
 
105
    */
 
106
    void mute(bool state) { }
 
107
 
 
108
    /**
 
109
      Reset the sound device.
 
110
    */
 
111
    void reset() { }
 
112
 
 
113
    /**
 
114
      Sets the sound register to a given value.
 
115
 
 
116
      @param addr  The register address
 
117
      @param value The value to save into the register
 
118
      @param cycle The system cycle at which the register is being updated
 
119
    */
 
120
    void set(uInt16 addr, uInt8 value, Int32 cycle) { }
 
121
 
 
122
    /**
 
123
      Sets the volume of the sound device to the specified level.  The
 
124
      volume is given as a percentage from 0 to 100.  Values outside
 
125
      this range indicate that the volume shouldn't be changed at all.
 
126
 
 
127
      @param percent The new volume percentage level for the sound device
 
128
    */
 
129
    void setVolume(Int32 percent) { }
 
130
 
 
131
    /**
 
132
      Adjusts the volume of the sound device based on the given direction.
 
133
 
 
134
      @param direction  Increase or decrease the current volume by a predefined
 
135
                        amount based on the direction (1 = increase, -1 =decrease)
 
136
    */
 
137
    void adjustVolume(Int8 direction) { }
 
138
 
 
139
public:
 
140
    /**
 
141
      Loads the current state of this device from the given Deserializer.
 
142
 
 
143
      @param in The deserializer device to load from.
 
144
      @return The result of the load.  True on success, false on failure.
 
145
    */
 
146
    bool load(Deserializer& in);
 
147
 
 
148
    /**
 
149
      Saves the current state of this device to the given Serializer.
 
150
 
 
151
      @param out The serializer device to save to.
 
152
      @return The result of the save.  True on success, false on failure.
 
153
    */
 
154
    bool save(Serializer& out);
 
155
};
 
156
 
 
157
#endif