--- linuxsampler/trunk/src/engines/gig/DiskThread.h 2007/02/03 15:33:00 1038 +++ linuxsampler/trunk/src/engines/gig/DiskThread.h 2007/09/04 01:12:49 1321 @@ -3,7 +3,7 @@ * LinuxSampler - modular, streaming capable sampler * * * * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * - * Copyright (C) 2005, 2006 Christian Schoenebeck * + * Copyright (C) 2005 - 2007 Christian Schoenebeck * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -55,9 +55,10 @@ String GetBufferFillBytes(); String GetBufferFillPercentage(); int OrderNewStream(Stream::reference_t* pStreamRef, ::gig::DimensionRegion* pDimRgn, unsigned long SampleOffset, bool DoLoop); - int OrderDeletionOfStream(Stream::reference_t* pStreamRef); + int OrderDeletionOfStream(Stream::reference_t* pStreamRef, bool bRequestNotification = false); int OrderDeletionOfDimreg(::gig::DimensionRegion* dimreg); Stream* AskForCreatedStream(Stream::OrderID_t StreamOrderID); + Stream::Handle AskForDeletedStream(); // the number of streams currently in usage // printed on the console the main thread (along with the active voice count) @@ -84,6 +85,7 @@ Stream* pStream; Stream::Handle hStream; Stream::OrderID_t OrderID; + bool bNotify; }; // Attributes @@ -91,7 +93,8 @@ uint Streams; RingBuffer* CreationQueue; ///< Contains commands to create streams RingBuffer* DeletionQueue; ///< Contains commands to delete streams - RingBuffer* GhostQueue; ///< Contains handles to streams that are not used anymore and weren't deletable immediately + RingBuffer* GhostQueue; ///< Contains handles to streams that are not used anymore and weren't deletable immediately + RingBuffer 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< ::gig::DimensionRegion*,false>* DeleteDimregQueue; ///< Contains dimension regions that are not used anymore and should be handed back to the instrument resource manager unsigned int RefillStreamsPerRun; ///< How many streams should be refilled in each loop run Stream* pStreams[CONFIG_MAX_STREAMS]; ///< Contains all disk streams (whether used or unused)