/[svn]/linuxsampler/trunk/src/engines/gig/DiskThread.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/DiskThread.h

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

revision 1424 by schoenebeck, Sun Oct 14 22:00:17 2007 UTC revision 1879 by schoenebeck, Sun Mar 29 18:43:40 2009 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2009 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 30  Line 30 
30    
31  #include "../../common/Thread.h"  #include "../../common/Thread.h"
32  #include "../../common/RingBuffer.h"  #include "../../common/RingBuffer.h"
33    #include "../../common/atomic.h"
34  #include "Stream.h"  #include "Stream.h"
35  #include "Voice.h"  #include "Voice.h"
36    
# Line 49  namespace LinuxSampler { namespace gig { Line 50  namespace LinuxSampler { namespace gig {
50      class DiskThread : public Thread {      class DiskThread : public Thread {
51          public:          public:
52              // Methods              // Methods
53              DiskThread(uint BufferWrapElements, InstrumentResourceManager* pInstruments);              DiskThread(int MaxStreams, uint BufferWrapElements, InstrumentResourceManager* pInstruments);
54              virtual ~DiskThread();              virtual ~DiskThread();
55              void    Reset();              void    Reset();
56              String  GetBufferFillBytes();              String  GetBufferFillBytes();
# Line 62  namespace LinuxSampler { namespace gig { Line 63  namespace LinuxSampler { namespace gig {
63    
64              // the number of streams currently in usage              // the number of streams currently in usage
65              // printed on the console the main thread (along with the active voice count)              // printed on the console the main thread (along with the active voice count)
66              int ActiveStreamCount;              uint GetActiveStreamCount() { return atomic_read(&ActiveStreamCount); }
67                void SetActiveStreamCount(uint Streams) { atomic_set(&ActiveStreamCount, Streams); }
68              int ActiveStreamCountMax;              int ActiveStreamCountMax;
69    
70          protected:          protected:
# Line 97  namespace LinuxSampler { namespace gig { Line 99  namespace LinuxSampler { namespace gig {
99              RingBuffer<Stream::Handle,false>    DeletionNotificationQueue;          ///< In case the original sender requested a notification for its stream deletion order, this queue will receive the handle of the respective stream once actually be deleted by the disk thread.              RingBuffer<Stream::Handle,false>    DeletionNotificationQueue;          ///< In case the original sender requested a notification for its stream deletion order, this queue will receive the handle of the respective stream once actually be deleted by the disk thread.
100              RingBuffer< ::gig::DimensionRegion*,false>* DeleteDimregQueue;          ///< Contains dimension regions that are not used anymore and should be handed back to the instrument resource manager              RingBuffer< ::gig::DimensionRegion*,false>* DeleteDimregQueue;          ///< Contains dimension regions that are not used anymore and should be handed back to the instrument resource manager
101              unsigned int                   RefillStreamsPerRun;                    ///< How many streams should be refilled in each loop run              unsigned int                   RefillStreamsPerRun;                    ///< How many streams should be refilled in each loop run
102              Stream*                        pStreams[CONFIG_MAX_STREAMS];            ///< Contains all disk streams (whether used or unused)              Stream**                       pStreams; ///< Contains all disk streams (whether used or unused)
103              Stream*                        pCreatedStreams[CONFIG_MAX_STREAMS + 1]; ///< This is where the voice (audio thread) picks up it's meanwhile hopefully created disk stream.              Stream**                       pCreatedStreams; ///< This is where the voice (audio thread) picks up it's meanwhile hopefully created disk stream.
104              static Stream*                 SLOT_RESERVED;                          ///< This value is used to mark an entry in pCreatedStreams[] as reserved.              static Stream*                 SLOT_RESERVED;                          ///< This value is used to mark an entry in pCreatedStreams[] as reserved.
105              InstrumentResourceManager*     pInstruments;                           ///< The instrument resource manager of the engine that is using this disk thread. Used by the dimension region deletion feature.              InstrumentResourceManager*     pInstruments;                           ///< The instrument resource manager of the engine that is using this disk thread. Used by the dimension region deletion feature.
106    
# Line 108  namespace LinuxSampler { namespace gig { Line 110  namespace LinuxSampler { namespace gig {
110              void                           RefillStreams();              void                           RefillStreams();
111              Stream::Handle                 CreateHandle();              Stream::Handle                 CreateHandle();
112              Stream::OrderID_t              CreateOrderID();              Stream::OrderID_t              CreateOrderID();
113    
114                atomic_t ActiveStreamCount;
115      };      };
116    
117  }} // namespace LinuxSampler::gig  }} // namespace LinuxSampler::gig

Legend:
Removed from v.1424  
changed lines
  Added in v.1879

  ViewVC Help
Powered by ViewVC