/[svn]/linuxsampler/trunk/src/stream.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/stream.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 17 by schoenebeck, Wed Nov 5 14:47:10 2003 UTC revision 18 by schoenebeck, Sun Dec 7 05:03:43 2003 UTC
# Line 36  Line 36 
36  #include "global.h"  #include "global.h"
37  #include "ringbuffer.h"  #include "ringbuffer.h"
38  #include "gig.h"  #include "gig.h"
39            
 #define STREAM_END_SILENCE_SAMPLES        
40  class Stream {  class Stream {
41      public:      public:
42          // Member Types          // Member Types
# Line 101  class Stream { Line 100  class Stream {
100          inline static uint       GetUnusedStreams() { return UnusedStreams; }          inline static uint       GetUnusedStreams() { return UnusedStreams; }
101      protected:      protected:
102          // Methods          // Methods
103          void                     Launch(reference_t* pExportReference, gig::Sample* pSample, unsigned long SampleOffset);          void                     Launch(Stream::Handle hStream, reference_t* pExportReference, gig::Sample* pSample, unsigned long SampleOffset);
104          inline void              Kill() { pExportReference = NULL; Reset(); } ///< Will be called by disk thread after a 'deletion' command from the audio thread (within the voice class)          inline void              Kill()      { pExportReference = NULL; Reset(); } ///< Will be called by disk thread after a 'deletion' command from the audio thread (within the voice class)
105          inline Stream::Handle GetHandle() {          inline Stream::Handle    GetHandle() { return hThis; }
106              return (pExportReference) ? pExportReference->hStream : 0;          inline Stream::state_t   GetState()  { return State; }
         }  
         inline Stream::state_t   GetState() { return State; }  
107          friend class DiskThread; // only the disk thread should be able to launch and most important kill a disk stream to avoid race conditions          friend class DiskThread; // only the disk thread should be able to launch and most important kill a disk stream to avoid race conditions
108      private:      private:
109          // Attributes          // Attributes
110          reference_t*             pExportReference;          reference_t*             pExportReference;
111          state_t                  State;          state_t                  State;
112            Stream::Handle           hThis;
113          gig::Sample*             pSample;          gig::Sample*             pSample;
114          unsigned long            SampleOffset;          unsigned long            SampleOffset;
115          RingBuffer<sample_t>*    pRingBuffer;          RingBuffer<sample_t>*    pRingBuffer;
# Line 123  class Stream { Line 121  class Stream {
121          inline void Reset() {          inline void Reset() {
122              pSample      = NULL;              pSample      = NULL;
123              SampleOffset = 0;              SampleOffset = 0;
124                hThis        = 0;
125              pRingBuffer->init(); // reset ringbuffer              pRingBuffer->init(); // reset ringbuffer
126              if (State != state_unused) {              if (State != state_unused) {
127                  // we can't do 'SetPos(state_unused)' here, due to possible race conditions)                  // we can't do 'SetPos(state_unused)' here, due to possible race conditions)

Legend:
Removed from v.17  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC