@@ -315,18 +315,17 @@ class FlacWriter : public AudioFormatWriter | |||
{ | |||
public: | |||
//============================================================================== | |||
FlacWriter (OutputStream* const out, | |||
const double sampleRate_, | |||
const int numChannels_, | |||
const int bitsPerSample_) | |||
FlacWriter (OutputStream* const out, double sampleRate_, | |||
int numChannels_, int bitsPerSample_, int qualityOptionIndex) | |||
: AudioFormatWriter (out, TRANS (flacFormatName), | |||
sampleRate_, | |||
numChannels_, | |||
bitsPerSample_) | |||
sampleRate_, numChannels_, bitsPerSample_) | |||
{ | |||
using namespace FlacNamespace; | |||
encoder = FLAC__stream_encoder_new(); | |||
if (qualityOptionIndex > 0) | |||
FLAC__stream_encoder_set_compression_level (encoder, jmin (8, qualityOptionIndex)); | |||
FLAC__stream_encoder_set_do_mid_side_stereo (encoder, numChannels == 2); | |||
FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, numChannels == 2); | |||
FLAC__stream_encoder_set_channels (encoder, numChannels); | |||
@@ -510,20 +509,9 @@ const Array <int> FlacAudioFormat::getPossibleBitDepths() | |||
return Array <int> (depths); | |||
} | |||
bool FlacAudioFormat::canDoStereo() | |||
{ | |||
return true; | |||
} | |||
bool FlacAudioFormat::canDoMono() | |||
{ | |||
return true; | |||
} | |||
bool FlacAudioFormat::isCompressed() | |||
{ | |||
return true; | |||
} | |||
bool FlacAudioFormat::canDoStereo() { return true; } | |||
bool FlacAudioFormat::canDoMono() { return true; } | |||
bool FlacAudioFormat::isCompressed() { return true; } | |||
AudioFormatReader* FlacAudioFormat::createReaderFor (InputStream* in, | |||
const bool deleteStreamIfOpeningFails) | |||
@@ -544,11 +532,11 @@ AudioFormatWriter* FlacAudioFormat::createWriterFor (OutputStream* out, | |||
unsigned int numberOfChannels, | |||
int bitsPerSample, | |||
const StringPairArray& /*metadataValues*/, | |||
int /*qualityOptionIndex*/) | |||
int qualityOptionIndex) | |||
{ | |||
if (getPossibleBitDepths().contains (bitsPerSample)) | |||
{ | |||
ScopedPointer<FlacWriter> w (new FlacWriter (out, sampleRate, numberOfChannels, bitsPerSample)); | |||
ScopedPointer<FlacWriter> w (new FlacWriter (out, sampleRate, numberOfChannels, bitsPerSample, qualityOptionIndex)); | |||
if (w->ok) | |||
return w.release(); | |||
@@ -33,15 +33,15 @@ | |||
//============================================================================== | |||
/** | |||
Holds a list of simple objects, such as ints, doubles, or pointers. | |||
Holds a resizable array of primitive or copy-by-value objects. | |||
Examples of arrays are: Array<int>, Array<Rectangle> or Array<MyClass*> | |||
The array can be used to hold simple, non-polymorphic objects as well as primitive types - to | |||
The Array class can be used to hold simple, non-polymorphic objects as well as primitive types - to | |||
do so, the class must fulfil these requirements: | |||
- it must have a copy constructor and operator= | |||
- it must be able to be relocated in memory by a memcpy without this causing a problem - so no | |||
objects whose functionality relies on pointers or references to themselves can be used. | |||
- it must have a copy constructor and assignment operator | |||
- it must be able to be relocated in memory by a memcpy without this causing any problems - so | |||
objects whose functionality relies on external pointers or references to themselves can be used. | |||
You can of course have an array of pointers to any kind of object, e.g. Array <MyClass*>, but if | |||
you do this, the array doesn't take any ownership of the objects - see the OwnedArray class or the | |||
@@ -283,8 +283,6 @@ public: | |||
menuCreationTime = lastFocused = lastScroll = Time::getMillisecondCounter(); | |||
setWantsKeyboardFocus (true); | |||
setMouseClickGrabsKeyboardFocus (false); | |||
setOpaque (true); | |||
setAlwaysOnTop (true); | |||
Desktop::getInstance().addGlobalMouseListener (this); | |||
@@ -324,6 +322,7 @@ public: | |||
ScopedPointer <Window> mw (new Window()); | |||
mw->setLookAndFeel (menu.lookAndFeel); | |||
mw->setWantsKeyboardFocus (false); | |||
mw->setOpaque (mw->getLookAndFeel().findColour (PopupMenu::backgroundColourId).isOpaque() || ! Desktop::canUseSemiTransparentWindows()); | |||
mw->minimumWidth = minimumWidth; | |||
mw->maximumNumColumns = maximumNumColumns; | |||
mw->standardItemHeight = standardItemHeight; | |||
@@ -370,6 +369,9 @@ public: | |||
//============================================================================== | |||
void paint (Graphics& g) | |||
{ | |||
if (isOpaque()) | |||
g.fillAll (Colours::white); | |||
getLookAndFeel().drawPopupMenuBackground (g, getWidth(), getHeight()); | |||
} | |||
@@ -1861,6 +1861,7 @@ private: | |||
return 0; | |||
case WM_WINDOWPOSCHANGED: | |||
doMouseEvent (getCurrentMousePos()); | |||
handleMovedOrResized(); | |||
if (dontRepaint) | |||