Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kmatheussen/radium
Browse files Browse the repository at this point in the history
  • Loading branch information
kmatheussen committed May 6, 2016
2 parents 66bc9ae + e92dc11 commit cd88ad2
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 26 deletions.
18 changes: 18 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
Changes 3.8.1 -> 3.8.2:
* Fix reset bottom bar volume slider
* Turn on GL pause by default for Linux users not using an nvidia card
* mouse: Use track under mouse when turning on/off cent text / velocity text /
fx text, not the track the cursor is placed on.
* Upgraded to latest version of s7
* api: msleep
* Add Post-recording tools GUI to the quantization menu (in addition to the MIDI menu)
* Fix inverted MIDI volume slider
* Delete all MIDI instrument windows when creating new song. Also fixes
crashes that can happen when loading new song.
* Fix peaks in bottom bar volume slider, and don't crash if creating and deleting
"System output" sound objects in a special order.
* Don't do autobackup if the editor doesn't have keyboard focus
* Obtain keyboard focus when showing popup menu
* Can select MIDI instruments from track header again


Changes 3.8.0 -> 3.8.1:
* Track paste: Fix undo/redo if it was necessary to create instrument,
and autoconnect to main bus if creating new instrument.
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Qt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Users and packagers: Edit build_*.sh instead.
#

VERSION = 3.8.1
VERSION = 3.8.2

#----------------USER SETTINGS-------------------------------

Expand Down
22 changes: 21 additions & 1 deletion OpenGL/Widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,9 +1180,29 @@ QWidget *GL_create_widget(QWidget *parent){
printf("vendor: %s, renderer: %s, version: %s \n",(const char*)ATOMIC_GET(GE_vendor_string),(const char*)ATOMIC_GET(GE_renderer_string),(const char*)ATOMIC_GET(GE_version_string));
//getchar();




bool show_mesa_warning = true;

#ifdef FOR_LINUX
if (!s_version.contains("nvidia", Qt::CaseInsensitive) && SETTINGS_read_bool("show_not_nvidia_warning", true)) {
GL_set_pause_rendering_on_off(true);

GFX_Message(NULL,
"It seems like you are not using an NVIDIA card or the nvidia gfx driver."
"<p>"
"In order to avoid seemingly random crashes, the option \"Briefly pause graphics rendering when opening windows\" has been enabled "
"under the \"Windows\" tab in the \"Preferences\" window."
"<p>"
"In case you are using a new GFX driver, you might want to uncheck this option."
"<p>"
"You will not see this warning again."
);

SETTINGS_write_bool("show_not_nvidia_warning", false);
}

if (s_vendor.contains("ATI"))
if (SETTINGS_read_bool("show_catalyst_gfx_message_during_startup", true)) {
vector_t v = {};
Expand Down Expand Up @@ -1296,7 +1316,7 @@ QWidget *GL_create_widget(QWidget *parent){
"\n"
"In addition, the graphics tends to not look as good."
);

}

g_gl_widget_started = true;
Expand Down
9 changes: 7 additions & 2 deletions Qt/Qt_bottom_bar_widget_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ class Bottom_bar_widget : public QWidget, public Ui::Bottom_bar_widget {

if (g_system_out_patch==NULL && g_system_out_plugin != NULL)
g_system_out_patch = (struct Patch*)g_system_out_plugin->patch;

if (g_system_audio_instrument_widget == NULL && g_system_out_patch != NULL) {
g_bottom_bar_widget->system_volume_slider->_patch = g_system_out_patch;

g_system_audio_instrument_widget = InstrumentWidget_get_audio_instrument_widget(g_system_out_patch);
if (g_system_audio_instrument_widget != NULL)
bottom_bar_widget->system_volume_slider->setValue(g_system_audio_instrument_widget->input_volume_slider->value());
Expand Down Expand Up @@ -391,7 +393,10 @@ extern "C"{
g_system_out_plugin = plugin;
g_system_out_patch = NULL;
g_system_audio_instrument_widget = NULL;


g_bottom_bar_widget->system_volume_slider->_patch = NULL;
g_bottom_bar_widget->system_volume_slider->_effect_num = EFFNUM_INPUT_VOLUME;

if (plugin == NULL){

static float nullfloats[2] = {0.0f, 0.0f};
Expand Down
45 changes: 43 additions & 2 deletions api/api_various.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "../OpenGL/Render_proc.h"
#include "../common/OS_string_proc.h"
#include "../audio/SoundProducer_proc.h"
#include "../audio/Mixer_proc.h"


#ifdef _AMIGA
Expand Down Expand Up @@ -415,6 +416,11 @@ void openToolsDialog(void){
}

void openAboutWindow(void){
float length = getSongLength();
int minutes = length / 60;
int seconds = length - (minutes*60);
int s2 = (length - floorf(length)) * 100.0f;

GFX_Message(NULL,"<center><b>Radium " VERSION "</b></center>"
"<p>"
"OpenGL vendor: \"%s\"<br>"
Expand All @@ -423,12 +429,15 @@ void openAboutWindow(void){
"OpenGL flags: %x<br>"
"Qt version: \"%s\""
"<p>"
"<A href=\"http://users.notam02.no/~kjetism/radium/development.php\">Credits</A>",
"<A href=\"http://users.notam02.no/~kjetism/radium/development.php\">Credits</A>"
"<p>"
"Song length: %02d : %02d : %02d",
ATOMIC_GET(GE_vendor_string)==NULL ? "(null)" : ATOMIC_GET(GE_vendor_string),
ATOMIC_GET(GE_renderer_string)==NULL ? "(null)" : ATOMIC_GET(GE_renderer_string),
ATOMIC_GET(GE_version_string)==NULL ? "(null)" : ATOMIC_GET(GE_version_string),
ATOMIC_GET(GE_opengl_version_flags),
GFX_qVersion()
GFX_qVersion(),
minutes, seconds, s2
);
}

Expand Down Expand Up @@ -1357,6 +1366,33 @@ void setPlaylistBlock(int pos, int blocknum){
BL_setBlock(pos, block);
}

static double get_block_length(struct Blocks *block){
double time = block->times[block->num_lines].time;

time /= (double)block->reltempo;

return time / (double)MIXER_get_sample_rate();
}

float getBlockLength(int blocknum, int windownum){
struct WBlocks *wblock = getWBlockFromNum(windownum, blocknum);
if(wblock==NULL) return 1.0; // return 1.0 instead of 0.0 to avoid divide by zero errors.

return get_block_length(wblock->block);
}

float getSongLength(void){
struct Blocks **playlist = root->song->playlist;
double result = 0.0;

int i;
for(i=0;i<root->song->length;i++)
result += get_block_length(playlist[i]);

return result;
}


int getLogtypeHold(void){
return LOGTYPE_HOLD;
}
Expand Down Expand Up @@ -1384,3 +1420,8 @@ char *toBase64(const char *s){
char *fromBase64(const char *s){
return STRING_get_chars(STRING_fromBase64(STRING_create(s)));
}

void msleep(int ms){
usleep(1000*ms);
}

8 changes: 8 additions & 0 deletions api/protos.conf
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ volumeDown
mute
int isPlaying

#playNote | int instrumentnum | float pitch | float volume
#stopNote | int instrumentnum | float pitch | float volume
#setPlayingNotePitch | int instrumentnum | float pitch | float volume

float lineDuration | int line | int tracknum ? -1 | int blocknum ? -1 | int windownum ? -1


Expand Down Expand Up @@ -426,13 +430,17 @@ testErrorMessage
setPlaylistLength | int len
setPlaylistBlock | int pos | int blocknum

float getBlockLength | int blocknum ? -1 | int windownum ? -1 # returns seconds
float getSongLength # returns seconds

int getLogtypeHold
Place getCursorPlace | int blocknum ? -1 | int windownum ? -1
int getCursorTrack | int windownum ? -1
int getHighestLegalPlaceDenominator

char* toBase64 | const_char* s
char* fromBase64 | const_char* s
void msleep | int ms


#/*******************************************
Expand Down
29 changes: 18 additions & 11 deletions audio/SoundPlugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,18 @@ static float gain_2_slider(float gain, float db_min, float db_max){
const float threshold_gain = powf(10,
scale(threshold_val, 0.0f, 1.0f, db_min, db_max) / 20.0f);

float ret;

if(gain <= threshold_gain) // Below threshold, we do a linear conversion. If not there will be a jump between 0 and almost 0.
return scale(gain,
ret = scale(gain,
0.0f, threshold_val,
0.0f, threshold_gain);
else
return scale(20 * log10(gain),
db_min, db_max,
0.0f, 1.0f);
ret = scale(20 * log10(gain),
db_min, db_max,
0.0f, 1.0f);

return R_BOUNDARIES(0.0f, ret, 1.0f);
}

static float gain_2_db(float val, const float db_min, const float db_max){
Expand Down Expand Up @@ -156,9 +160,11 @@ static float gain_2_db(float val, const float db_min, const float db_max){

static float frequency_2_slider(float freq, const float min_freq, const float max_freq){
const float min_output = logf(min_freq)/logf(max_freq);
return scale( logf(freq)/logf(max_freq),
min_output, 1.0,
0.0, 1.0);
return R_BOUNDARIES(0.0f,
scale( logf(freq)/logf(max_freq),
min_output, 1.0,
0.0, 1.0),
1.0f);
}

static float slider_2_frequency(float slider, const float min_freq, const float max_freq){
Expand Down Expand Up @@ -649,12 +655,13 @@ void PLUGIN_set_effect_value2(struct SoundPlugin *plugin, int64_t time, int effe
float store_value = value;
//printf("set effect value. effect_num: %d, value: %f, num_effects: %d\n",effect_num,value,plugin->type->num_effects);

#if !defined(RELEASE)
if(value_format==PLUGIN_FORMAT_SCALED) {
R_ASSERT(value >= 0.0f);
R_ASSERT(value <= 1.0f);
}
#if !defined(RELEASE)
R_ASSERT(value >= -0.0001f); // don't report floating point rounding errors
R_ASSERT(value <= 1.0001f); // don't report floating point rounding errors
#endif
value = R_BOUNDARIES(0.0f, value, 1.0f);
}

if(effect_num < plugin->type->num_effects){

Expand Down
1 change: 1 addition & 0 deletions bin/menues.conf
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Edit
Block | ra.quantitizeBlock()
Track | ra.quantitizeTrack()
Range | ra.quantitizeRange()
MIDI post-recording tools (includes GUI for quantization) | ra.openToolsDialog()
Invert
Block | ra.invertBlock()
Track | ra.invertTrack()
Expand Down
Binary file modified bin/packages/s7.tar.gz
Binary file not shown.
5 changes: 1 addition & 4 deletions bin/scheme/instruments.scm
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@

(<ra> :get-undo-history)

todo:
* Fix load preset
* Check if cancelUndo is called automatically if no undo has been added.
* Check if instrument widget for deleted patch is hidden.

!!#


Expand Down
16 changes: 11 additions & 5 deletions bin/scheme/mouse.scm
Original file line number Diff line number Diff line change
Expand Up @@ -950,14 +950,20 @@
)

(define (track-configuration-popup X Y)
(popup-menu "Pianoroll (left alt + p)" :check (<ra> :pianoroll-visible *current-track-num*) ra:show-pianoroll
"Note text (left alt + n)" :check (<ra> :note-track-visible *current-track-num*) ra:show-note-track
(c-display "TRACK " *current-track-num*)
(popup-menu "Pianoroll (left alt + p)" :check (<ra> :pianoroll-visible *current-track-num*) (lambda (onoff)
(<ra> :show-pianoroll onoff *current-track-num*))
"Note text (left alt + n)" :check (<ra> :note-track-visible *current-track-num*) (lambda (onoff)
(<ra> :show-note-track onoff *current-track-num*))
(list "Cents"
:check (<ra> :centtext-visible *current-track-num*)
:enabled (<ra> :centtext-can-be-turned-off *current-track-num*)
ra:show-centtext)
"Velocity text (left alt + y)" :check (<ra> :veltext-visible *current-track-num*) ra:show-veltext
"FX text" :check (<ra> :fxtext-visible *current-track-num*) ra:show-fxtext
(lambda (onoff)
(<ra> :show-centtext onoff *current-track-num*)))
"Velocity text (left alt + y)" :check (<ra> :veltext-visible *current-track-num*) (lambda (onoff)
(<ra> :show-veltext onoff *current-track-num*))
"FX text" :check (<ra> :fxtext-visible *current-track-num*) (lambda (onoff)
(<ra> :show-fxtext onoff *current-track-num*))
"-------"
"Copy Track (left alt + c)" (lambda ()
(<ra> :copy-track *current-track-num*))
Expand Down
2 changes: 2 additions & 0 deletions mixergui/QM_MixerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,13 @@ static bool stop_moving_chips(MyScene *myscene, float mouse_x, float mouse_y){

Undo_Close();

// TODO: has_updated returns true if the chip was just moved around a bit. Need to store original position for has_updated to get correct value.
if (has_updated==false)
Undo_CancelLastUndo();

myscene->_moving_chips.clear();

// TODO: the function currently returns correct value, but it can not return 'has_updated' when 'has_updated' gets correct value, since we don't want to ask user to replace chip after moving it around a bit.
return has_updated;
}

Expand Down

0 comments on commit cd88ad2

Please sign in to comment.