Skip to content

Commit

Permalink
Spash screen onptimisations
Browse files Browse the repository at this point in the history
Small Fadeout improvement
Doc updates
  • Loading branch information
abrolag committed Feb 13, 2017
1 parent d13ff33 commit 2593799
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 62 deletions.
5 changes: 5 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
yoshimi 1.5.0 M

2017-2-13 Will
* Spash screen onptimisations.
* Small Fadeout improvement.
* Doc updates.

2017-2-12 Will
* Separated out temporary Gui Write -> Read per section.
This enables us to do conversions section by section.
Expand Down
2 changes: 2 additions & 0 deletions Util/1stReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ sh MakeSplash.sh <imagefile>
This converts any .svg or .png image to a hex dump and embeds it in the Yoshimi source so that on the next 'make' it will become the new splash screen. SVGs are preferred as they can be easily editied to include version numbers etc.

The file 'splashdefault.png' is the current released screen - it was created before SVG capability was available, and 'splashreference.svg' is the slightly modifed form of one created by Jesper that can be used as a template.

You will need to give the full filepath for both "MakeSplash.sh" and your image file.
2 changes: 1 addition & 1 deletion Util/MakeSplash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if [ "$EXTEN" = "svg" ]; then
echo
exit 1
fi
# Extract width and height values from the svg - somehwat reliant on inkscapes svg formatting
# Extract width and height values from the svg - somewhat reliant on inkscapes svg formatting
WIDTH=$(sed -n -E '1,/\s*width=/ {/width/ s/.*width="(.*)"/\1/p;}' "$FILE")
HEIGHT=$(sed -n -E '1,/\s*height=/ {/height/ s/.*height="(.*)"/\1/p;}' "$FILE")

Expand Down
2 changes: 1 addition & 1 deletion src/Misc/ConfBuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
*/

#define BUILD_NUMBER 957
#define BUILD_NUMBER 958
3 changes: 1 addition & 2 deletions src/Misc/SynthEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,7 @@ int SynthEngine::MasterAudio(float *outl [NUM_MIDI_PARTS + 1], float *outr [NUM_
writeRBP(6, fadeAll, 0); // stop and master reset
else if ((fadeAll & 0xff) == 3)
writeRBP(6, fadeAll >> 8, 0); // load patchset
fadeAll = 0;
}

// Peak computation for part vu meters
Expand Down Expand Up @@ -2374,7 +2375,6 @@ void SynthEngine::ShutUp(void)
insefx[nefx]->cleanup();
for (int nefx = 0; nefx < NUM_SYS_EFX; ++nefx)
sysefx[nefx]->cleanup();
fadeAll = 0;
}


Expand Down Expand Up @@ -2434,7 +2434,6 @@ int SynthEngine::loadPatchSetAndUpdate(string fname)
setAllPartMaps();
addHistory(fname, 2);
actionLock(unlock);
fadeAll = 0;
}

if (result)
Expand Down
2 changes: 1 addition & 1 deletion src/UI/MasterUI.fl
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ collect_data(synth, value, (Fl::event_button() | type), control, part, 0xff, eng
{
prefix = synth->makeUniqueName("");
prefix = prefix.substr(0, prefix.length() - 3);
panel = prefix + "Mixer Panel";
panel = prefix + " : Mixer Panel";
}
masterwindow->copy_label(prefix.c_str());
panelwindow->copy_label(panel.c_str());
Expand Down
74 changes: 17 additions & 57 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,43 +103,29 @@ static void *mainGuiThread(void *arg)

map<SynthEngine *, MusicClient *>::iterator it;
fl_register_images();
#if (FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION < 3)
char *fname = tmpnam(NULL);
if (fname)
{
FILE *f = fopen(fname, "wb");
if (f)
{
fwrite(splashPngData, splashPngLength, 1, f);
fclose(f);
}
}
Fl_PNG_Image pix(fname);
if (fname)
unlink(fname);
#else

Fl_PNG_Image pix("splash_screen_png", splashPngData, splashPngLength);
#endif

//const int textHeight = 20;
//const int textBorder = 15;
const int textHeight = 15;
const int textY = 20;
const float timeout = 2.5f;
const int textColour = FL_DARK_BLUE;//WHITE;//CYAN;

Fl_Window winSplash(splashWidth, splashHeight, "yoshimi splash screen");
Fl_Box box(0, 0, splashWidth,splashHeight);
//Fl_Pixmap pix(yoshimi_logo);

Fl_Box box(0, 0, splashWidth,splashHeight);
box.image(pix);
//Fl_Box boxLb(textBorder, splashHeight - textHeight * 2, splashWidth - textBorder * 2, textHeight);
//boxLb.box(FL_NO_BOX);
//boxLb.align(FL_ALIGN_CENTER);
//boxLb.labelsize(textHeight);
//boxLb.labeltype(FL_NORMAL_LABEL);
//boxLb.labelcolor(FL_WHITE);
//boxLb.labelfont(FL_HELVETICA | FL_BOLD);
/*boxLb.labelfont(FL_HELVETICA | FL_ITALIC);

string startup = YOSHIMI_VERSION;
startup = "Yoshimi " + startup + " is starting";
boxLb.label(startup.c_str());*/
startup = "V " + startup;

Fl_Box boxLb(0, splashHeight - textY - textHeight, splashWidth, textHeight, startup.c_str());
boxLb.box(FL_NO_BOX);
boxLb.align(FL_ALIGN_CENTER);
boxLb.labelsize(textHeight);
boxLb.labeltype(FL_NORMAL_LABEL);
boxLb.labelcolor(textColour);
boxLb.labelfont(FL_HELVETICA | FL_BOLD);

winSplash.set_modal();
//winSplash.clear_border();
Expand All @@ -149,21 +135,11 @@ static void *mainGuiThread(void *arg)
{
winSplash.position((Fl::w() - winSplash.w()) / 2, (Fl::h() - winSplash.h()) / 2);
winSplash.show();
Fl::add_timeout(2, splashTimeout, &winSplash);
Fl::add_timeout(timeout, splashTimeout, &winSplash);
}

do
{
/*if (bShowGui)
{
Fl::wait(0.033333);
while (!splashMessages.empty())
{
boxLb.copy_label(splashMessages.front().c_str());
splashMessages.pop_front();
}
}
else*/
usleep(33333);
}
while (firstSynth == NULL); // just wait
Expand Down Expand Up @@ -230,11 +206,6 @@ static void *mainGuiThread(void *arg)
if (bShowGui)
{
Fl::wait(0.033333);
/*while (!splashMessages.empty())
{
boxLb.copy_label(splashMessages.front().c_str());
splashMessages.pop_front();
}*/
GuiThreadMsg::processGuiMessages();
}
else
Expand Down Expand Up @@ -273,15 +244,6 @@ bool mainCreateNewInstance(unsigned int forceId)
goto bail_out;
}


/* this is done in newMusicClient() now! ^^^^^
if (!(musicClient->Open()))
{
synth->getRuntime().Log("Failed to open MusicClient");
goto bail_out;
}
*/

if (!synth->Init(musicClient->getSamplerate(), musicClient->getBuffersize()))
{
synth->getRuntime().Log("SynthEngine init failed");
Expand Down Expand Up @@ -419,8 +381,6 @@ int main(int argc, char *argv[])
firstSynth->installBanks(0);
GuiThreadMsg::sendMessage(firstSynth, GuiThreadMsg::RefreshCurBank, 1);

//splashMessages.push_back("Startup complete!");

//create command line processing thread
pthread_t cmdThr;
if(bShowCmdLine)
Expand Down

0 comments on commit 2593799

Please sign in to comment.