case 0x46: // CH-1 ON 'F'
ack();
ld_audio |= 1;
- setvolumevideograb(32768);
+ setvolumevideograb(100 - currprefs.sound_volume_genlock);
break;
case 0x48: // CH-2 ON 'H'
ack();
ld_audio |= 2;
- setvolumevideograb(32768);
+ setvolumevideograb(100 - currprefs.sound_volume_genlock);
break;
case 0x47: // CH-1 OFF 'G'
ack();
alg_nvram_write();
}
}
- if (isvideograb()) {
- isvideograb_status();
- }
}
int alg_serial_write(void)
cfgfile_write (f, _T("sound_volume_cd"), _T("%d"), p->sound_volume_cd);
if (p->sound_volume_board >= 0)
cfgfile_write (f, _T("sound_volume_ahi"), _T("%d"), p->sound_volume_board);
+ if (p->sound_volume_midi >= 0)
+ cfgfile_write (f, _T("sound_volume_midi"), _T("%d"), p->sound_volume_midi);
+ if (p->sound_volume_genlock >= 0)
+ cfgfile_write (f, _T("sound_volume_genlock"), _T("%d"), p->sound_volume_genlock);
cfgfile_write_bool (f, _T("sound_auto"), p->sound_auto);
cfgfile_write_bool (f, _T("sound_cdaudio"), p->sound_cdaudio);
cfgfile_write_bool (f, _T("sound_stereo_swap_paula"), p->sound_stereo_swap_paula);
|| cfgfile_intval (option, value, _T("sound_volume_paula"), &p->sound_volume_paula, 1)
|| cfgfile_intval (option, value, _T("sound_volume_cd"), &p->sound_volume_cd, 1)
|| cfgfile_intval (option, value, _T("sound_volume_ahi"), &p->sound_volume_board, 1)
+ || cfgfile_intval (option, value, _T("sound_volume_midi"), &p->sound_volume_midi, 1)
+ || cfgfile_intval (option, value, _T("sound_volume_genlock"), &p->sound_volume_genlock, 1)
|| cfgfile_intval (option, value, _T("sound_stereo_separation"), &p->sound_stereo_separation, 1)
|| cfgfile_intval (option, value, _T("sound_stereo_mixing_delay"), &p->sound_mixed_stereo_delay, 1)
|| cfgfile_intval (option, value, _T("sampler_frequency"), &p->sampler_freq, 1)
int sound_volume_paula;
int sound_volume_cd;
int sound_volume_board;
+ int sound_volume_midi;
+ int sound_volume_genlock;
bool sound_stereo_swap_paula;
bool sound_stereo_swap_ahi;
bool sound_auto;
static int out_allocated = 0;
static volatile int exitin = 0;
static CRITICAL_SECTION cs_proc;
+
/*
* FUNCTION: getmidiouterr
*
return txt;
}
+static void MidiSetVolume(HMIDIOUT oh)
+{
+ TCHAR err[MAX_DPATH];
+ MMRESULT verr;
+ DWORD vol = 0xffffffff;
+ if (currprefs.sound_volume_midi > 0) {
+ uae_u16 v = (uae_u16)(65535.0 - (65535.0 * currprefs.sound_volume_midi / 100.0));
+ vol = (v << 16) | v;
+ }
+ verr = midiOutSetVolume (oh, vol);
+ if (verr) {
+ write_log(_T("MIDI OUT: midiOutSetVolume error %s / %d\n"), getmidiouterr(err, verr), verr);
+ }
+}
+
/*
* FUNCTION: MidiOut_Alloc
*
result = 0;
} else {
InitializeCriticalSection(&cs_proc);
+ MidiSetVolume(outHandle);
// We don't need input for output...
if((currprefs.win32_midiindev >= 0) &&
(result = midiInOpen(&inHandle, currprefs.win32_midiindev, (DWORD_PTR)MidiInProc, 0, CALLBACK_FUNCTION|MIDI_IO_STATUS))) {
hr = filterGraph->QueryInterface(IID_IMediaEvent, (void**)&mediaEvent);
hr = filterGraph->QueryInterface(IID_IBasicAudio, (void**)&audio);
- setvolumevideograb(0);
+ setvolumevideograb(100 - currprefs.sound_volume_genlock);
hr = filterGraph->QueryInterface(IID_IMediaControl, (void**)&mediaControl);
if (FAILED(hr)) {
{
if (!audio)
return;
- long vol = log10((float)volume / 32768.0) * 4000.0;
+ long vol = log10((float)volume / 100.0) * 4000.0;
audio->put_Volume(vol);
}
{
if (!videoInitialized)
return;
+ if (currprefs.sound_volume_genlock != changed_prefs.sound_volume_genlock) {
+ currprefs.sound_volume_genlock = changed_prefs.sound_volume_genlock;
+ setvolumevideograb(100 - currprefs.sound_volume_genlock);
+ }
if (mediaEvent == NULL)
return;
long EventCode;
}
if (currprefs.win32_midiindev != changed_prefs.win32_midiindev ||
currprefs.win32_midioutdev != changed_prefs.win32_midioutdev ||
+ currprefs.sound_volume_midi != changed_prefs.sound_volume_midi ||
currprefs.win32_midirouter != changed_prefs.win32_midirouter)
{
currprefs.win32_midiindev = changed_prefs.win32_midiindev;
currprefs.win32_midioutdev = changed_prefs.win32_midioutdev;
+ currprefs.sound_volume_midi = changed_prefs.sound_volume_midi;
currprefs.win32_midirouter = changed_prefs.win32_midirouter;
#ifdef SERIAL_PORT
if (midi_ready) {
idx = SendDlgItemMessage (hDlg, IDC_SOUNDVOLUMESELECT, CB_GETCURSEL, 0, 0);
if (idx != volumeselectionindex) {
volumeselectionindex = idx;
- if (volumeselectionindex < 0 || volumeselectionindex > 2)
+ if (volumeselectionindex < 0 || volumeselectionindex > 4)
volumeselectionindex = 0;
if (volumeselectionindex == 1)
volumeselection = &workprefs.sound_volume_cd;
else if (volumeselectionindex == 2)
volumeselection = &workprefs.sound_volume_board;
+ else if (volumeselectionindex == 3)
+ volumeselection = &workprefs.sound_volume_midi;
+ else if (volumeselectionindex == 4)
+ volumeselection = &workprefs.sound_volume_genlock;
else
volumeselection = &workprefs.sound_volume_paula;
update_soundgui (hDlg);
SendDlgItemMessage (hDlg, IDC_SOUNDVOLUMESELECT, CB_ADDSTRING, 0, (LPARAM)_T("Paula"));
SendDlgItemMessage (hDlg, IDC_SOUNDVOLUMESELECT, CB_ADDSTRING, 0, (LPARAM)_T("CD"));
SendDlgItemMessage (hDlg, IDC_SOUNDVOLUMESELECT, CB_ADDSTRING, 0, (LPARAM)_T("AHI"));
+ SendDlgItemMessage (hDlg, IDC_SOUNDVOLUMESELECT, CB_ADDSTRING, 0, (LPARAM)_T("MIDI"));
+ SendDlgItemMessage (hDlg, IDC_SOUNDVOLUMESELECT, CB_ADDSTRING, 0, (LPARAM)_T("Genlock"));
SendDlgItemMessage (hDlg, IDC_SOUNDVOLUMESELECT, CB_SETCURSEL, volumeselectionindex, 0);
SendDlgItemMessage (hDlg, IDC_SOUNDCARDLIST, CB_RESETCONTENT, 0, 0L);
uninitvideograb();
genlock_video = false;
}
+ isvideograb_status();
#endif
if (currprefs.genlock_image != 4 && currprefs.genlock_image != 5 && currprefs.genlock_image != 6) {
genlock_video_file[0] = 0;