Hi,
Can anyone put me out of my misery please!?
Currently, the Menu's populate with the correct names but the Menu B isn't behaving as it should. If I select a sample from Menu B the wrong sound is played. It is playing the Group linked to Menu A and not the from the groups linked to Menu B.
Also, the incorrect zone is being displayed in Waveform B.
What am I missing here? I guess it is a simple mistake I have made.
Thanks muchly.
on init
make_perfview
declare const $UI_HEIGHT := 220
set_ui_height_px(220)
set_skin_offset(0)
message ("")
declare $Menu_A_LAST := 1
declare $Menu_B_LAST := 3
declare $Count_Menu_A
declare $Count_Menu_B
declare $Zone_A
declare $Zone_B
declare $Event_A
declare $Event_B
{SAMPLE SELECT MENUS}
declare $i
declare $GROUP_COUNT
$GROUP_COUNT := $NUM_GROUPS / 2
declare ui_menu $MENU_A
move_control_px($MENU_A, 216, 106)
set_control_par(get_ui_id($MENU_A), $CONTROL_PAR_WIDTH, 91)
declare ui_menu $MENU_B
move_control_px($MENU_B, 326, 106)
set_control_par(get_ui_id($MENU_B), $CONTROL_PAR_WIDTH, 91)
while ($i < $GROUP_COUNT)
add_menu_item($MENU_A, group_name($i), $i)
add_menu_item($MENU_B, group_name($i + $GROUP_COUNT), $i)
inc($i)
end while
make_persistent($MENU_A)
make_persistent($MENU_B)
{WAVEFORM DISPLAY - A + B}
declare ui_waveform $Waveform_A (6, 6)
move_control_px($Waveform_A, 5, 79)
set_control_par(get_ui_id($Waveform_A), $CONTROL_PAR_WIDTH, 202)
set_control_par(get_ui_id($Waveform_A), $CONTROL_PAR_HEIGHT, 46)
set_control_par(get_ui_id($Waveform_A), $CONTROL_PAR_BG_ALPHA, 9000000h)
set_control_par(get_ui_id($Waveform_A), $CONTROL_PAR_WAVE_COLOR, 9ffffffh)
hide_part ($Waveform_A, $HIDE_PART_BG)
declare ui_waveform $Waveform_B (6, 6)
move_control_px($Waveform_B, 426, 79)
set_control_par(get_ui_id($Waveform_B), $CONTROL_PAR_WIDTH, 202)
set_control_par(get_ui_id($Waveform_B), $CONTROL_PAR_HEIGHT, 46)
set_control_par(get_ui_id($Waveform_B), $CONTROL_PAR_BG_ALPHA, 9000000h)
set_control_par(get_ui_id($Waveform_B), $CONTROL_PAR_WAVE_COLOR, 9ffffffh)
hide_part ($Waveform_B, $HIDE_PART_BG)
end on
{FUNCTIONS}
{ATTACH WAVEFORM ZONE A + B}
function FUNC_ATTACH_ZONE_A
$Zone_A := play_note(48, 1, 0, 100)
change_vol($Zone_A, -500000, 0)
if ($Zone_A # -1)
set_event_par_arr($Zone_A, $EVENT_PAR_ALLOW_GROUP, 0, $ALL_GROUPS)
set_event_par_arr($Zone_A, $EVENT_PAR_ALLOW_GROUP, 1, $Menu_A)
wait(1000)
attach_zone($Waveform_A, get_event_par($Zone_A, $EVENT_PAR_ZONE_ID), 0)
message("")
end if
end function
function FUNC_ATTACH_ZONE_B
$Zone_B := play_note(48, 1, 0, 100)
change_vol($Zone_B, -500000, 0)
if ($Zone_B # -1)
set_event_par_arr($Zone_B, $EVENT_PAR_ALLOW_GROUP, 0, $ALL_GROUPS)
set_event_par_arr($Zone_B, $EVENT_PAR_ALLOW_GROUP, 1, $Menu_B)
wait(1000)
attach_zone($Waveform_B, get_event_par($Zone_B, $EVENT_PAR_ZONE_ID), 0)
message("")
end if
end function
{ON UI CONTROLS}
{ON UI CONTROLS - MENU A + B}
on ui_control ($Menu_A)
$Count_Menu_A := 0
while ($Count_Menu_A <= $Menu_A_LAST)
purge_group($Count_Menu_A, 0)
inc($Count_Menu_A)
end while
purge_group($Menu_A, 1)
purge_group($Menu_B, 1)
call FUNC_ATTACH_ZONE_A
end on
on ui_control ($Menu_B)
$Count_Menu_B := 0
while ($Count_Menu_B <= $Menu_B_LAST)
purge_group($Count_Menu_B, 0)
inc($Count_Menu_B)
end while
purge_group($Menu_A, 1)
purge_group($Menu_B, 1)
call FUNC_ATTACH_ZONE_B
end on
{ON PERSISTENCE}
on persistence_changed
wait(10000)
call FUNC_ATTACH_ZONE_A
call FUNC_ATTACH_ZONE_B
end on