Skip to content

Commit

Permalink
made the move to of0.9 and to ofxMightyUI with ofxFontStash2
Browse files Browse the repository at this point in the history
  • Loading branch information
kritzikratzi committed Mar 5, 2016
1 parent e95a7d8 commit c8b010b
Show file tree
Hide file tree
Showing 10 changed files with 213 additions and 84 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@ ifndef OF_ROOT
OF_ROOT=../../..
endif

copy_osx_files:
cp -r $(OF_ROOT)/addons/ofxMightyUI/bin/data/ bin/$(APPNAME).app/Contents/Resources/
cp -r $(OF_ROOT)/addons/ofxFontAwesome/bin/data/ bin/$(APPNAME).app/Contents/Resources/


PROJECT_AFTER_OSX=make copy_osx_files

# call the project makefile!
include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk
219 changes: 175 additions & 44 deletions Oscilloscope.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

24 changes: 11 additions & 13 deletions bin/data/settings.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
exportHeight=1080
exportWidth=1920
exportFrameRate=60
afterglow=0.476471
intensity=1
hue=151.395
numPts=7
blur=139.209
strokeWeight=3.97843
afterglow=0.5
intensity=0.4
hue=50
numPts=20
blur=30
strokeWeight=11.623
inputVolume=1
outputVolume=0.47695
outputVolume=1
autoDetect=true
invertY=false
invertX=false
flipXY=false
channelMapping=
scale=2
deviceId=1
port=11995
sampleRate=96000
bufferSize=512
scale=1
deviceId=2
numBuffers=4
sampleRate=44100
bufferSize=512
31 changes: 11 additions & 20 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# WARNING

Currently transitioning to OF0.9.
The next few days will be a bit messy.

---


Oscilloscope
===

Expand All @@ -25,11 +17,13 @@ This is the programming documentation. If you are not a programmer please

# Project setup

1. Download and unzip Openframeworks 0.84
1. Download and unzip Openframeworks 0.9.2 or newer
1. Move this project into apps/myApps/oscilloscope
1. Clone [ofxMightyUI](https://github.com/kritzikratzi/ofxMightyUI) into addons/ofxMightyUI
1. Clone [ofxMightyUI](https://github.com/kritzikratzi/ofxMightyUI) into addons/ofxMightyUI. Switch to the branch `fs2`!
1. Clone [ofxAvCodec](https://github.com/kritzikratzi/ofxAvCodec) into ofxAvCodec.
1. (This is seriously painful) Follow the instructions in ofxAvCodec/ffmpeg_src/readme.md and compile shared libraries for your platform
1. Clone [ofxFontAwesome](https://github.com/kritzikratzi/ofxFontAwesome) into addons/ofxFontAwesome
1. Clone [ofxFontStash2](https://github.com/armadillu/ofxFontStash2) into addons/ofxFontStash2


### Compiling with XCode
Expand All @@ -38,9 +32,12 @@ This is the programming documentation. If you are not a programmer please
1. run `scripts/prepare.sh osx`
1. Open apps/myApps/oscilloscope/Oscilloscope.xcodeproject and then Build&Run

You can also build with `make && make run` on the command line. The resulting build will have no icon/no proper name/no retina support.

### Compiling with Visual studio

**The visual studio project files are not up to date**

1. run `scripts/clean.sh`
1. run `scripts/prepare.sh win32`
1. Open oscilloscope.sln and Build&Run
Expand All @@ -53,17 +50,11 @@ This is the programming documentation. If you are not a programmer please

See scripts/readme.md for the full distribution process.

### Package the software


## Openframeworks 0.84 vs 0.9

This project compiles under Openframeworks 0.84. Only a few tiny changes are required for 0.9RC2:

* sounddevices.h: Change RtError to RtAudioError
* ofApp.h: Change ofRect to ofDrawRectangle


This project will transition to OF 0.9 as soon as the first stable version is released.
* for osx run `scripts/dist.sh $platform $version`
* platform is one of `osx linux linux64 win32 win64`
* version is whatever version you want, e.g. `1.0.6`

## Experimenting with the shaders

Expand Down
2 changes: 1 addition & 1 deletion scripts/dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ platform=$1

if [[ -z "$version" || -z "$platform" ]]
then
echo "Usage: dist.sh <version> <platform>"
echo "Usage: dist.sh <platform> <version>"
exit
fi

Expand Down
4 changes: 2 additions & 2 deletions src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Globals{
int exportHeight;
int exportFrameRate;

void loadFromFile( string settingsFile = ofToDataPath("settings.txt") ){
void loadFromFile( string settingsFile = ofToDataPath("settings.txt",true) ){
ofxIniSettings settings = ofxIniSettings(settingsFile);
bufferSize = settings.get( "bufferSize", bufferSize );
sampleRate = settings.get("sampleRate", sampleRate );
Expand All @@ -74,7 +74,7 @@ class Globals{
}


void saveToFile( string settingsFile = ofToDataPath("settings.txt") ){
void saveToFile( string settingsFile = ofToDataPath("settings.txt",true) ){
ofxIniSettings settings = ofxIniSettings(settingsFile);

settings.set( "bufferSize", bufferSize );
Expand Down
3 changes: 2 additions & 1 deletion src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ bool applicationRunning = false;

//--------------------------------------------------------------
void ofApp::setup(){
mui::MuiConfig::fontSize = 16;
showInfo = false;
dropped = 0;
changed = false;
Expand Down Expand Up @@ -381,7 +382,7 @@ void ofApp::draw(){

void ofApp::exit(){
stopApplication();
ofExit();
std::exit(0);
}


Expand Down
2 changes: 1 addition & 1 deletion src/ui/FMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ void FMenu::touchDoubleTap( ofTouchEventArgs &touch ){

//--------------------------------------------------------------
void FMenu::buttonPressed( const void * sender, ofTouchEventArgs &args ){
onPress( sender, args );
onPress.notify( sender, args );
}
1 change: 0 additions & 1 deletion src/ui/OsciView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ void OsciView::sliderChanged( const void * sender, float & value ){

mui::Label * OsciView::addLabel( string text ){
mui::Label * label = new mui::Label( text, 0, 0, 100, 30 );
label->fontSize = 10;
label->commit();
label->width = label->boundingBox.width;
label->horizontalAlign = mui::Right;
Expand Down
4 changes: 3 additions & 1 deletion src/util/sounddevices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ bool getDefaultRtOutputParams( int &deviceId, int &sampleRate, int &bufferSize,
if( rates.size() == 0 ){
sampleRate = 44100; // safe guess
}
else if( std::find(rates.begin(), rates.end(), 44100) != rates.end()){
sampleRate = 44100;
}
else{
sampleRate = *max_element(rates.begin(), rates.end());
}

#ifdef _WIN32
bufferSize = 1024;
#elif __APPLE__
Expand Down

0 comments on commit c8b010b

Please sign in to comment.