Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Font handling, and an audio device-related crash fix. #17

Merged
merged 10 commits into from

2 participants

@akmokhtari

The 2.0 update isn't here, sadly, but here are a few (hopefully useful) changes:

  • Error handling for getting the audio device. If you've got (for example) a browser open, it might hog control of the audio source, causing the program to crash. This implements a retry/quit dialog so that users can at least get an idea of what the problem is.

  • Added serialized cpmono fonts, and set CustomLookAndFeel up to handle them. You can now use Font("Paragraph Font", fontSize, Font::fontStyle) to create fonts. I admit that it's not clear to me whether people will like this abstraction, so perhaps it should be modified again so that you can use the typeface names directly: Font("CPMono Bold", fontSize, Font::fontStyle).

  • Removed some obsolete macros.

akmokhtari added some commits
@akmokhtari akmokhtari Added serialized CPMono fonts 3c4d1c6
@akmokhtari akmokhtari Implemented error handling for audio device initialization
If there was a problem initializing the AudioDeviceManager, we show an
AlertWindow with Retry/Quit options.  Unfortunately, this doesn't fix the bug I
was initially trying to fix, because sometimes initialize() returns OK while
setting the AudioDeviceManager to null.
f92cfd1
@akmokhtari akmokhtari Error handling for when an audio device isn't found
Sometimes initialize() returns no error string, but will not find an audio
device, leaving aIOd == null.  This checks for that, and aborts the app with an
informational dialog window if so.
0f0bedd
@akmokhtari akmokhtari Fixed EditorViewport crash on keypresses
Before, EditorViewport would start accessing arrays on keypresses (specifically
the arrow keys) even when there were no editors.  This adds an extra check to
prevent this.
2ef4ec7
@akmokhtari akmokhtari Merge branch 'master' of https://github.com/open-ephys/GUI 3fe158f
@akmokhtari akmokhtari Added font files to BinaryData d61c1f5
@akmokhtari akmokhtari Added embedded typeface handling to CustomLookAndFeel
Added typeface initialization to CustomLookAndFeel, and implemented
getTypefaceForFont().

Fonts can now be created using a more centralized method, by calling the
Font(String("Typeface Name"), fontHeight, Font::style) constructor.  Names for
the typefaces ("Default Light", "Paragraph") should be regarded as tentative.

There's also simpler code to do the same thing that should be uncommented after
the 2.0 update (it uses HashMap, which is not currently in our library code,
even though it's in the 1.53 docs.)
6558238
@akmokhtari akmokhtari Removed deprecated Juce T() macros 2dc0abb
@akmokhtari akmokhtari Merge branch 'master' of https://github.com/open-ephys/GUI
Conflicts:
	Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj
	JuceLibraryCode/BinaryData.cpp
	JuceLibraryCode/JuceHeader.h
4a4cb7a
@akmokhtari akmokhtari Merge branch 'master' of https://github.com/open-ephys/GUI 207c411
@open-ephys open-ephys merged commit e97166e into open-ephys:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 16, 2012
  1. @akmokhtari
  2. @akmokhtari

    Implemented error handling for audio device initialization

    akmokhtari authored
    If there was a problem initializing the AudioDeviceManager, we show an
    AlertWindow with Retry/Quit options.  Unfortunately, this doesn't fix the bug I
    was initially trying to fix, because sometimes initialize() returns OK while
    setting the AudioDeviceManager to null.
  3. @akmokhtari

    Error handling for when an audio device isn't found

    akmokhtari authored
    Sometimes initialize() returns no error string, but will not find an audio
    device, leaving aIOd == null.  This checks for that, and aborts the app with an
    informational dialog window if so.
  4. @akmokhtari

    Fixed EditorViewport crash on keypresses

    akmokhtari authored
    Before, EditorViewport would start accessing arrays on keypresses (specifically
    the arrow keys) even when there were no editors.  This adds an extra check to
    prevent this.
Commits on Nov 21, 2012
  1. @akmokhtari
Commits on Nov 22, 2012
  1. @akmokhtari
Commits on Nov 23, 2012
  1. @akmokhtari

    Added embedded typeface handling to CustomLookAndFeel

    akmokhtari authored
    Added typeface initialization to CustomLookAndFeel, and implemented
    getTypefaceForFont().
    
    Fonts can now be created using a more centralized method, by calling the
    Font(String("Typeface Name"), fontHeight, Font::style) constructor.  Names for
    the typefaces ("Default Light", "Paragraph") should be regarded as tentative.
    
    There's also simpler code to do the same thing that should be uncommented after
    the 2.0 update (it uses HashMap, which is not currently in our library code,
    even though it's in the 1.53 docs.)
Commits on Nov 24, 2012
  1. @akmokhtari
Commits on Nov 29, 2012
  1. @akmokhtari

    Merge branch 'master' of https://github.com/open-ephys/GUI

    akmokhtari authored
    Conflicts:
    	Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj
    	JuceLibraryCode/BinaryData.cpp
    	JuceLibraryCode/JuceHeader.h
Commits on Dec 16, 2012
  1. @akmokhtari
This page is out of date. Refresh to see the latest.
Showing with 1,492 additions and 93 deletions.
  1. +1 −1  Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj
  2. +2 −0  Builds/VisualStudio2010/open-ephys.vcxproj
  3. +15 −0 Builds/VisualStudio2010/open-ephys.vcxproj.filters
  4. +1,231 −1 JuceLibraryCode/BinaryData.cpp
  5. +16 −1 JuceLibraryCode/BinaryData.h
  6. BIN  Resources/Fonts/cpmono-black-serialized
  7. BIN  Resources/Fonts/cpmono-bold-serialized
  8. BIN  Resources/Fonts/cpmono-extralight-serialized
  9. BIN  Resources/Fonts/cpmono-light-serialized
  10. BIN  Resources/Fonts/cpmono-plain-serialized
  11. BIN  Resources/Fonts/cpmono_light.ttf
  12. BIN  Resources/Fonts/cpmono_plain.ttf
  13. BIN  Resources/Fonts/cpmono_v07_black.ttf
  14. BIN  Resources/Fonts/cpmono_v07_bold.ttf
  15. BIN  Resources/Fonts/cpmono_v07_extralight.ttf
  16. +43 −10 Source/Audio/AudioComponent.cpp
  17. +3 −3 Source/MainWindow.cpp
  18. +2 −2 Source/Processors/Editors/AudioEditor.cpp
  19. +2 −2 Source/Processors/Editors/MergerEditor.cpp
  20. +2 −2 Source/Processors/Editors/SplitterEditor.cpp
  21. +4 −4 Source/UI/ControlPanel.cpp
  22. +87 −11 Source/UI/CustomLookAndFeel.cpp
  23. +60 −42 Source/UI/CustomLookAndFeel.h
  24. +5 −5 Source/UI/EditorViewport.cpp
  25. +9 −9 Source/UI/UIComponent.cpp
  26. +10 −0 open-ephys.jucer
View
2  Builds/MacOSX/open-ephys.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 44;
+ objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
View
2  Builds/VisualStudio2010/open-ephys.vcxproj
@@ -75,6 +75,7 @@
<ProgramDatabaseFile>.\Debug\open-ephys.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
+ <AdditionalOptions>-lftdi -lftgl %(AdditionalOptions)</AdditionalOptions>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
@@ -115,6 +116,7 @@
<TargetMachine>MachineX86</TargetMachine>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <AdditionalOptions>-lftdi -lftgl %(AdditionalOptions)</AdditionalOptions>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
View
15 Builds/VisualStudio2010/open-ephys.vcxproj.filters
@@ -64,6 +64,21 @@
</Filter>
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="..\..\Resources\Fonts\cpmono-black-serialized">
+ <Filter>open-ephys\Resources\Fonts</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Resources\Fonts\cpmono-bold-serialized">
+ <Filter>open-ephys\Resources\Fonts</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Resources\Fonts\cpmono-extralight-serialized">
+ <Filter>open-ephys\Resources\Fonts</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Resources\Fonts\cpmono-light-serialized">
+ <Filter>open-ephys\Resources\Fonts</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\Resources\Fonts\cpmono-plain-serialized">
+ <Filter>open-ephys\Resources\Fonts</Filter>
+ </ClCompile>
<ClCompile Include="..\..\Resources\Fonts\BebasNeue.otf">
<Filter>open-ephys\Resources\Fonts</Filter>
</ClCompile>
View
1,232 JuceLibraryCode/BinaryData.cpp
1,231 additions, 1 deletion not shown
View
17 JuceLibraryCode/BinaryData.h
@@ -1,12 +1,27 @@
/* =========================================================================================
- This is an auto-generated file, created by The Jucer V3.0.0
+ This is an auto-generated file, created by The Introjucer 3.0.0
Do not edit anything in this file!
*/
namespace BinaryData
{
+ extern const char* cpmonoblackserialized;
+ const int cpmonoblackserializedSize = 15547;
+
+ extern const char* cpmonoboldserialized;
+ const int cpmonoboldserializedSize = 16442;
+
+ extern const char* cpmonoextralightserialized;
+ const int cpmonoextralightserializedSize = 17136;
+
+ extern const char* cpmonolightserialized;
+ const int cpmonolightserializedSize = 18090;
+
+ extern const char* cpmonoplainserialized;
+ const int cpmonoplainserializedSize = 17831;
+
extern const char* BebasNeue_otf;
const int BebasNeue_otfSize = 48648;
View
BIN  Resources/Fonts/cpmono-black-serialized
Binary file not shown
View
BIN  Resources/Fonts/cpmono-bold-serialized
Binary file not shown
View
BIN  Resources/Fonts/cpmono-extralight-serialized
Binary file not shown
View
BIN  Resources/Fonts/cpmono-light-serialized
Binary file not shown
View
BIN  Resources/Fonts/cpmono-plain-serialized
Binary file not shown
View
BIN  Resources/Fonts/cpmono_light.ttf
Binary file not shown
View
BIN  Resources/Fonts/cpmono_plain.ttf
Binary file not shown
View
BIN  Resources/Fonts/cpmono_v07_black.ttf
Binary file not shown
View
BIN  Resources/Fonts/cpmono_v07_bold.ttf
Binary file not shown
View
BIN  Resources/Fonts/cpmono_v07_extralight.ttf
Binary file not shown
View
53 Source/Audio/AudioComponent.cpp
@@ -27,19 +27,52 @@
AudioComponent::AudioComponent() : isPlaying(false)
{
-
- deviceManager.initialise(0, // numInputChannelsNeeded
- 2, // numOutputChannelsNeeded
- 0, // *savedState (XmlElement)
- true, // selectDefaultDeviceOnFailure
- String::empty, // preferred device
- 0); // preferred device setup options
-
+ // if this is nonempty, we got an error
+ String error = deviceManager.initialise(0, // numInputChannelsNeeded
+ 2, // numOutputChannelsNeeded
+ 0, // *savedState (XmlElement)
+ true, // selectDefaultDeviceOnFailure
+ String::empty, // preferred device
+ 0); // preferred device setup options
+ if (error != String::empty)
+ {
+ String titleMessage = String("Audio device initialization error");
+ String contentMessage = String("There was a problem initializing the audio device:\n" + error);
+ // this uses a bool since there are only two options
+ // also, omitting parameters works fine, even though the docs don't show defaults
+ bool retryButtonClicked = AlertWindow::showOkCancelBox(AlertWindow::QuestionIcon,
+ titleMessage,
+ contentMessage,
+ String("Retry"),
+ String("Quit"));
+
+ if (retryButtonClicked)
+ {
+ // as above
+ error = deviceManager.initialise(0, 2, 0, true, String::empty, 0);
+ } else { // quit button clicked
+ JUCEApplication::quit();
+ }
+ }
+
+
AudioIODevice* aIOd = deviceManager.getCurrentAudioDevice();
+ // the error string doesn't tell you if there's no audio device found...
+ if (aIOd == 0)
+ {
+ String titleMessage = String("No audio device found");
+ String contentMessage = String("Couldn't find an audio device. ") +
+ String("Perhaps some other program has control of the default one.");
+ AlertWindow::showMessageBox(AlertWindow::InfoIcon,
+ titleMessage,
+ contentMessage);
+ JUCEApplication::quit();
+ }
+
+
std::cout << "Got audio device." << std::endl;
- String devType = deviceManager.getCurrentAudioDeviceType();
String devName = aIOd->getName();
std::cout << std::endl << "Audio device name: " << devName << std::endl;
@@ -56,7 +89,7 @@ AudioComponent::AudioComponent() : isPlaying(false)
String msg = deviceManager.setAudioDeviceSetup(setup, false);
- devType = deviceManager.getCurrentAudioDeviceType();
+ String devType = deviceManager.getCurrentAudioDeviceType();
std::cout << "Audio device type: " << devType << std::endl;
float sr = setup.sampleRate;
View
6 Source/MainWindow.cpp
@@ -152,7 +152,7 @@ void MainWindow::loadWindowBounds()
XmlDocument doc (file);
XmlElement* xml = doc.getDocumentElement();
- if (xml == 0 || ! xml->hasTagName (T("MAINWINDOW")))
+ if (xml == 0 || ! xml->hasTagName ("MAINWINDOW"))
{
std::cout << "File not found." << std::endl;
@@ -161,7 +161,7 @@ void MainWindow::loadWindowBounds()
} else {
- String description;// = T(" ");
+ String description;
forEachXmlChildElement (*xml, e)
{
@@ -183,4 +183,4 @@ void MainWindow::loadWindowBounds()
delete xml;
}
// return "Everything went ok.";
-}
+}
View
4 Source/Processors/Editors/AudioEditor.cpp
@@ -87,7 +87,7 @@ AudioEditor::AudioEditor (AudioNode* owner)
audioWindowButton->setToggleState(false,false);
addAndMakeVisible(audioWindowButton);
- volumeSlider = new Slider (T("High-Cut Slider"));
+ volumeSlider = new Slider ("High-Cut Slider");
volumeSlider->setRange(0,100,1);
volumeSlider->addListener(this);
volumeSlider->setTextBoxStyle(Slider::NoTextBox,
@@ -224,4 +224,4 @@ void AudioConfigurationWindow::resized()
void AudioConfigurationWindow::paint(Graphics& g)
{
g.fillAll(Colours::darkgrey);
-}
+}
View
4 Source/Processors/Editors/MergerEditor.cpp
@@ -25,7 +25,7 @@
#include "../Utilities/Merger.h"
// PipelineSelectorButton::PipelineSelectorButton()
-// : DrawableButton (T("Selector"), DrawableButton::ImageFitted)
+// : DrawableButton ("Selector", DrawableButton::ImageFitted)
// {
// DrawablePath normal, over, down;
@@ -152,4 +152,4 @@ void MergerEditor::switchSource()
Merger* processor = (Merger*) getProcessor();
processor->switchIO();
-}
+}
View
4 Source/Processors/Editors/SplitterEditor.cpp
@@ -25,7 +25,7 @@
#include "../Utilities/Splitter.h"
// PipelineSelectorButton::PipelineSelectorButton()
-// : DrawableButton (T("Selector"), DrawableButton::ImageFitted)
+// : DrawableButton ("Selector", DrawableButton::ImageFitted)
// {
// DrawablePath normal, over, down;
@@ -158,4 +158,4 @@ void SplitterEditor::switchDest()
pipelineSelectorA->setToggleState(false,false);
}
-}
+}
View
8 Source/UI/ControlPanel.cpp
@@ -27,7 +27,7 @@
#include <math.h>
PlayButton::PlayButton()
- : DrawableButton (T("PlayButton"), DrawableButton::ImageFitted)
+ : DrawableButton ("PlayButton", DrawableButton::ImageFitted)
{
DrawablePath normal, over, down;
@@ -61,7 +61,7 @@ PlayButton::~PlayButton()
}
RecordButton::RecordButton()
- : DrawableButton (T("RecordButton"), DrawableButton::ImageFitted)
+ : DrawableButton ("RecordButton", DrawableButton::ImageFitted)
{
DrawablePath normal, over, down;
@@ -88,7 +88,7 @@ RecordButton::~RecordButton()
}
-CPUMeter::CPUMeter() : Label(T("CPU Meter"),"0.0"), cpu(0.0f), lastCpu(0.0f)
+CPUMeter::CPUMeter() : Label("CPU Meter","0.0"), cpu(0.0f), lastCpu(0.0f)
{
MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false);
Typeface::Ptr typeface = new CustomTypeface(mis);
@@ -688,4 +688,4 @@ void ControlPanel::toggleState()
cpb->toggleState();
getUIComponent()->childComponentChanged();
-}
+}
View
98 Source/UI/CustomLookAndFeel.cpp
@@ -23,10 +23,50 @@
#include "CustomLookAndFeel.h"
-CustomLookAndFeel::CustomLookAndFeel()
+CustomLookAndFeel::CustomLookAndFeel() :
+ // third argument to MIS means don't copy the binary data to make a new stream
+ cpmonoExtraLightStream(BinaryData::cpmonoextralightserialized,
+ BinaryData::cpmonoextralightserializedSize,
+ false),
+ cpmonoLightStream(BinaryData::cpmonolightserialized,
+ BinaryData::cpmonolightserializedSize,
+ false),
+ cpmonoPlainStream(BinaryData::cpmonoplainserialized,
+ BinaryData::cpmonoplainserializedSize,
+ false),
+ cpmonoBoldStream(BinaryData::cpmonoboldserialized,
+ BinaryData::cpmonoboldserializedSize,
+ false),
+ cpmonoBlackStream(BinaryData::cpmonoblackserialized,
+ BinaryData::cpmonoblackserializedSize,
+ false),
+ misoRegularStream(BinaryData::misoserialized,
+ BinaryData::misoserializedSize,
+ false),
+ silkscreenStream(BinaryData::silkscreenserialized,
+ BinaryData::silkscreenserializedSize,
+ false),
+ // heap allocation is necessary here, because otherwise the typefaces are
+ // deleted too soon (there's a singleton typefacecache that holds references
+ // to them whenever they're used).
+ cpmonoExtraLight(new CustomTypeface(cpmonoExtraLightStream)),
+ cpmonoLight(new CustomTypeface(cpmonoLightStream)),
+ cpmonoPlain(new CustomTypeface(cpmonoPlainStream)),
+ cpmonoBold(new CustomTypeface(cpmonoBoldStream)),
+ cpmonoBlack(new CustomTypeface(cpmonoBlackStream)),
+ misoRegular(new CustomTypeface(misoRegularStream)),
+ silkscreen(new CustomTypeface(silkscreenStream))
+
{
- MemoryInputStream mis(BinaryData::misoserialized, BinaryData::misoserializedSize, false);
- Miso = new CustomTypeface(mis);
+
+ // UNCOMMENT AFTER UPDATE
+ // typefaceMap.set(String("Default Extra Light"), cpmonoExtraLight);
+ // typefaceMap.set(String("Default Light"), cpmonoLight);
+ // typefaceMap.set(String("Default"), cpmonoPlain);
+ // typefaceMap.set(String("Default Bold"), cpmonoBold);
+ // typefaceMap.set(String("Default Black"), cpmonoBlack);
+ // typefaceMap.set(String("Paragraph"), misoRegular);
+ // typefaceMap.set(String("Silkscreen"), silkscreen);
enum {
PROCESSOR_COLOR = 0x801,
@@ -47,21 +87,57 @@ CustomLookAndFeel::CustomLookAndFeel()
setColour(PopupMenu::highlightedBackgroundColourId, Colours::grey);
setColour(PopupMenu::highlightedTextColourId, Colours::yellow);
-
}
CustomLookAndFeel::~CustomLookAndFeel() {}
-// ===============
-// const Typeface::Ptr CustomLookAndFeel::getTypefaceForFont (const Font& font)
-// {
-
-// return Miso;
+//==============================================================================
+// FONT/TYPEFACE METHODS :
+//==============================================================================
-// }
+const Typeface::Ptr CustomLookAndFeel::getTypefaceForFont (const Font& font)
+{
+ String typefaceName = font.getTypefaceName();
+ // some of these names might be unnecessary, and there may be good ones
+ // missing. adjust as needed
+ if (typefaceName.equalsIgnoreCase("Default Extra Light"))
+ {
+ return cpmonoExtraLight;
+ } else if (typefaceName.equalsIgnoreCase("Default Light"))
+ {
+ return cpmonoLight;
+ } else if (typefaceName.equalsIgnoreCase("Default"))
+ {
+ return cpmonoPlain;
+ } else if (typefaceName.equalsIgnoreCase("Default Bold"))
+ {
+ return cpmonoBold;
+ } else if (typefaceName.equalsIgnoreCase("Default Black"))
+ {
+ return cpmonoBlack;
+ } else if (typefaceName.equalsIgnoreCase("Paragraph"))
+ {
+ return misoRegular;
+ } else if (typefaceName.equalsIgnoreCase("Small Text"))
+ {
+ return silkscreen;
+ } else // default
+ {
+ return LookAndFeel::getTypefaceForFont(font);
+ }
+
+ // UNCOMMENT AFTER UPDATE
+ // if (typefaceMap.contains(typefaceName))
+ // return typefaceMap[typefaceName];
+ // else
+ // return LookAndFeel::getTypefaceForFont(font);
+}
//==============================================================================
+// TAB METHODS :
+//==============================================================================
+
int CustomLookAndFeel::getTabButtonOverlap (int tabDepth)
{
return 0; //1 + tabDepth / 4;
@@ -616,4 +692,4 @@ void CustomLookAndFeel::drawComboBox (Graphics& g, int width, int height,
}
-}
+}
View
102 Source/UI/CustomLookAndFeel.h
@@ -31,24 +31,23 @@
/**
- Used to modify the appearance of the application.
+ Used to modify the appearance of the application.
- Currently contains methods for drawing custom tabs, custom
- scroll bars, and custom sliders.
+ Currently contains methods for drawing custom tabs, scroll bars, and sliders.
+ It also takes care of custom fonts via getTypefaceForFont().
- @see MainWindow
+ @see MainWindow
*/
class CustomLookAndFeel : public LookAndFeel
-
{
public:
- CustomLookAndFeel();
+ CustomLookAndFeel();
~CustomLookAndFeel();
- // ======== custom fonts ================
- Typeface::Ptr Miso;
+ // ======== custom typeface getter: =============================
+ const Typeface::Ptr getTypefaceForFont (const Font& font);
// ======== custom tab methods: =============================
@@ -74,9 +73,9 @@ class CustomLookAndFeel : public LookAndFeel
bool isFrontTab);
int getTabButtonBestWidth (int tabIndex,
- const String& text,
- int tabDepth,
- Button& button);
+ const String& text,
+ int tabDepth,
+ Button& button);
int getTabButtonSpaceAroundImage ();
@@ -111,50 +110,69 @@ class CustomLookAndFeel : public LookAndFeel
// ======== custom slider methods: =============================
void drawLinearSliderThumb (Graphics& g,
- int x, int y,
- int width, int height,
- float sliderPos,
- float minSliderPos,
- float maxSliderPos,
- const Slider::SliderStyle style,
- Slider& slider);
+ int x, int y,
+ int width, int height,
+ float sliderPos,
+ float minSliderPos,
+ float maxSliderPos,
+ const Slider::SliderStyle style,
+ Slider& slider);
void drawLinearSliderBackground (Graphics& g,
- int x, int y,
- int width, int height,
- float /*sliderPos*/,
- float /*minSliderPos*/,
- float /*maxSliderPos*/,
- const Slider::SliderStyle /*style*/,
- Slider& slider);
+ int x, int y,
+ int width, int height,
+ float /*sliderPos*/,
+ float /*minSliderPos*/,
+ float /*maxSliderPos*/,
+ const Slider::SliderStyle /*style*/,
+ Slider& slider);
int getSliderThumbRadius (Slider& slider);
void drawSliderKnob (Graphics& g,
- const float x, const float y,
- const float diameter,
- const Colour& colour,
- const float outlineThickness) throw();
+ const float x, const float y,
+ const float diameter,
+ const Colour& colour,
+ const float outlineThickness) throw();
void drawGlassPointer (Graphics& g,
- const float x, const float y,
- const float diameter,
- const Colour& colour, const float outlineThickness,
- const int direction) throw();
-
- // const Typeface::Ptr getTypefaceForFont (const Font& font);
+ const float x, const float y,
+ const float diameter,
+ const Colour& colour, const float outlineThickness,
+ const int direction) throw();
// ======== custom combo box methods: =============================
void drawComboBox (Graphics& g, int width, int height,
- const bool isButtonDown,
- int buttonX, int buttonY,
- int buttonW, int buttonH,
- ComboBox& box);
-
-private:
-
+ const bool isButtonDown,
+ int buttonX, int buttonY,
+ int buttonW, int buttonH,
+ ComboBox& box);
+
+private:
+
+ // UNCOMMENT AFTER UPDATE
+ // this maps strings to customtypeface pointers
+ //HashMap<String, Typeface::Ptr> typefaceMap;
+
+ MemoryInputStream
+ cpmonoExtraLightStream,
+ cpmonoLightStream,
+ cpmonoPlainStream,
+ cpmonoBoldStream,
+ cpmonoBlackStream,
+ misoRegularStream,
+ silkscreenStream;
+
+ Typeface::Ptr
+ cpmonoExtraLight,
+ cpmonoLight,
+ cpmonoPlain,
+ cpmonoBold,
+ cpmonoBlack,
+ misoRegular,
+ silkscreen;
};
View
10 Source/UI/EditorViewport.cpp
@@ -522,7 +522,7 @@ bool EditorViewport::keyPressed (const KeyPress &key) {
//std::cout << "Editor viewport received " << key.getKeyCode() << std::endl;
- if (canEdit)
+ if (canEdit && editorArray.size() > 0)
{
ModifierKeys mk = key.getModifiers();
@@ -1005,8 +1005,8 @@ XmlElement* EditorViewport::createNodeXml (GenericEditor* editor,
std::cout << name << std::endl;
- e->setAttribute (T("name"), name);
- e->setAttribute (T("insertionPoint"), insertionPt);
+ e->setAttribute ("name", name);
+ e->setAttribute ("insertionPoint", insertionPt);
// source->stateSaved = true;
@@ -1176,7 +1176,7 @@ const String EditorViewport::loadState()
XmlDocument doc (currentFile);
XmlElement* xml = doc.getDocumentElement();
- if (xml == 0 || ! xml->hasTagName (T("PROCESSORGRAPH")))
+ if (xml == 0 || ! xml->hasTagName ("PROCESSORGRAPH"))
{
std::cout << "File not found." << std::endl;
delete xml;
@@ -1185,7 +1185,7 @@ const String EditorViewport::loadState()
clearSignalChain();
- String description;// = T(" ");
+ String description;// = " ";
int loadOrder = 0;
forEachXmlChildElement (*xml, signalChain)
View
18 Source/UI/UIComponent.cpp
@@ -303,37 +303,37 @@ void UIComponent::getCommandInfo (CommandID commandID, ApplicationCommandInfo& r
{
case openConfiguration:
result.setInfo("Open configuration", "Load a saved processor graph.", "General", 0);
- result.addDefaultKeypress (T('O'), ModifierKeys::commandModifier);
+ result.addDefaultKeypress ('O', ModifierKeys::commandModifier);
result.setActive(!acquisitionStarted);
break;
case saveConfiguration:
result.setInfo("Save configuration", "Save the current processor graph.", "General", 0);
- result.addDefaultKeypress (T('S'), ModifierKeys::commandModifier);
+ result.addDefaultKeypress ('S', ModifierKeys::commandModifier);
result.setActive(!acquisitionStarted);
break;
case undo:
result.setInfo("Undo", "Undo the last action.", "General", 0);
- result.addDefaultKeypress (T('Z'), ModifierKeys::commandModifier);
+ result.addDefaultKeypress ('Z', ModifierKeys::commandModifier);
result.setActive(false);
break;
case redo:
result.setInfo("Redo", "Undo the last action.", "General", 0);
- result.addDefaultKeypress (T('Y'), ModifierKeys::commandModifier);
+ result.addDefaultKeypress ('Y', ModifierKeys::commandModifier);
result.setActive(false);
break;
case copySignalChain:
result.setInfo("Copy", "Copy a portion of the signal chain.", "General", 0);
- result.addDefaultKeypress (T('C'), ModifierKeys::commandModifier);
+ result.addDefaultKeypress ('C', ModifierKeys::commandModifier);
result.setActive(false);
break;
case pasteSignalChain:
result.setInfo("Paste", "Paste a portion of the signal chain.", "General", 0);
- result.addDefaultKeypress (T('V'), ModifierKeys::commandModifier);
+ result.addDefaultKeypress ('V', ModifierKeys::commandModifier);
result.setActive(false);
break;
@@ -345,19 +345,19 @@ void UIComponent::getCommandInfo (CommandID commandID, ApplicationCommandInfo& r
case toggleProcessorList:
result.setInfo("Processor List", "Show/hide Processor List.", "General", 0);
- result.addDefaultKeypress (T('P'), ModifierKeys::shiftModifier);
+ result.addDefaultKeypress ('P', ModifierKeys::shiftModifier);
result.setTicked(processorList->isOpen());
break;
case toggleSignalChain:
result.setInfo("Signal Chain", "Show/hide Signal Chain.", "General", 0);
- result.addDefaultKeypress (T('S'), ModifierKeys::shiftModifier);
+ result.addDefaultKeypress ('S', ModifierKeys::shiftModifier);
result.setTicked(editorViewportButton->isOpen());
break;
case toggleFileInfo:
result.setInfo("File Info", "Show/hide File Info.", "General", 0);
- result.addDefaultKeypress (T('F'), ModifierKeys::shiftModifier);
+ result.addDefaultKeypress ('F', ModifierKeys::shiftModifier);
result.setTicked(controlPanel->isOpen());
break;
View
10 open-ephys.jucer
@@ -27,6 +27,16 @@
<MAINGROUP id="h3HbSTV" name="open-ephys">
<GROUP id="0wpTCpt" name="Resources">
<GROUP id="kVU7EYu" name="Fonts">
+ <FILE id="g9dipB" name="cpmono-black-serialized" compile="0" resource="1"
+ file="Resources/Fonts/cpmono-black-serialized"/>
+ <FILE id="GORUO5" name="cpmono-bold-serialized" compile="0" resource="1"
+ file="Resources/Fonts/cpmono-bold-serialized"/>
+ <FILE id="UmmEdQ" name="cpmono-extralight-serialized" compile="0" resource="1"
+ file="Resources/Fonts/cpmono-extralight-serialized"/>
+ <FILE id="KSV8xW" name="cpmono-light-serialized" compile="0" resource="1"
+ file="Resources/Fonts/cpmono-light-serialized"/>
+ <FILE id="TOP1Rx" name="cpmono-plain-serialized" compile="0" resource="1"
+ file="Resources/Fonts/cpmono-plain-serialized"/>
<FILE id="ihWw2VV" name="BebasNeue.otf" compile="0" resource="1" file="Resources/Fonts/BebasNeue.otf"/>
<FILE id="frMIT7f" name="cpmono_bold.otf" compile="0" resource="1"
file="Resources/Fonts/cpmono_bold.otf"/>
Something went wrong with that request. Please try again.