# Path: procgame/game/mode.py
# class Mode(object):
#     class AcceptedSwitch:
#     class Delayed:
# class ModeQueue(object):
#     def __init__(self, game, priority):
#     def __scan_switch_handlers(self):
#     def add_switch_handler(self, name, event_type, delay, handler):
#     def status_str(self):
#     def delay(self, name=None, event_type=None, delay=0, handler=None, param=None):
#     def cancel_delayed(self, name):
#     def delay_info(self,name):
#     def extend_delay_by(self,name,delay):
#     def reset_delay_to(self,name,delay):
#     def is_delayed(self,name):
#     def handle_event(self, event):
#     def mode_started(self):
#     def mode_stopped(self):
#     def mode_topmost(self):
#     def mode_tick(self):
#     def dispatch_delayed(self):
#     def is_started(self):
#     def add_child_mode(self, mode):
#     def remove_child_mode(self, mode):
#     def __str__(self):
#     def update_lamps(self):
#         def __init__(self, name, event_type, delay, handler, param):
#         def __eq__(self, other):
#         def __str__(self):
#         def __init__(self, name, time, handler, event_type, param):
#         def __str__(self):
#     def __init__(self, game):
#     def add(self, mode):
#     def remove(self, mode):
#     def __iter__(self):
#     def __len__(self):
#     def __contains__(self, mode):
#     def __getitem__(self, v):
#     def handle_event(self, event):
#     def tick(self):
#     def log_queue(self, log_level=logging.INFO):
# def tabularize(rows, col_spacing=2):


import random
import time
import logging
import os.path
    import procgame
    import procgame.game.skeletongame
        import traceback
from procgame.game import mode
from collections import deque
from math import ceil
    from pygame import mixer # This call takes a while.
CH_MUSIC_2 = 3    # as above; note: these are useful if you want to pause music, start
                  # another song playing (other channel) and later resume that first track
                    # NOTE: using these channels will cause your music to be treated like _sounds_
                    # and that means they will be fully loaded into memory instead of streamed
                    # from the disk.  Unlike sounds pre-loaded with the assetManager, so unless they
                    # are registered as non-streaming, they will be loaded at playback time,
                    # which will introduce a delay

# this refers to all music channels which provides a default for
CH_ALL_MUSIC_CHANNELS = -2 # pause_music, unpause_music, stop_music, fadeout_music

# IF you add your own reserved channels, use numbers > 3 and < 8
# (num channels == 8 unless you change mixer.set_num_channels(8))
# example : CH_SPINNER = 4 # doing this would ensure that your spinner doesn't
#  eat all of your sound channels you would also need to add a
#  mixer.set_reserved(CH_SPINNER) in the __init__() below, and be sure that
#  whenever you play() the spinner effect, you do so on this CH_SPINNER channel

# PLAYBACK "Priorities" for VOICE playback
# PLAY_SIMULTANEOUS = 1   # STANDARD METHOD USING SHARED CHANNEL (CH_SFX)
PLAY_QUEUED = 2         # ADD TO QUEUED CHANNEL (CH_VOICE)
PLAY_FORCE = 3          # STOP ANY SOUNDS PLAYING AND PLAY THIS
PLAY_NOTBUSY= 4         # only play or queue if nothing is currently playing

DUCKED_MUSIC_PERCENT = 0.5    # drops the music volume to this percentage when ducking for voice lines
# it not enabled by default for asset_manager loadeds sounds
# (because the way the pygame queue works, it has to be enabled for all voice calls or no voice calls).
# enable (from game code) via:
#   self.sound.enable_music_ducking(True)


# Path: procgame/game/mode.py
# class Mode(object):
#     class AcceptedSwitch:
#     class Delayed:
# class ModeQueue(object):
#     def __init__(self, game, priority):
#     def __scan_switch_handlers(self):
#     def add_switch_handler(self, name, event_type, delay, handler):
#     def status_str(self):
#     def delay(self, name=None, event_type=None, delay=0, handler=None, param=None):
#     def cancel_delayed(self, name):
#     def delay_info(self,name):
#     def extend_delay_by(self,name,delay):
#     def reset_delay_to(self,name,delay):
#     def is_delayed(self,name):
#     def handle_event(self, event):
#     def mode_started(self):
#     def mode_stopped(self):
#     def mode_topmost(self):
#     def mode_tick(self):
#     def dispatch_delayed(self):
#     def is_started(self):
#     def add_child_mode(self, mode):
#     def remove_child_mode(self, mode):
#     def __str__(self):
#     def update_lamps(self):
#         def __init__(self, name, event_type, delay, handler, param):
#         def __eq__(self, other):
#         def __str__(self):
#         def __init__(self, name, time, handler, event_type, param):
#         def __str__(self):
#     def __init__(self, game):
#     def add(self, mode):
#     def remove(self, mode):
#     def __iter__(self):
#     def __len__(self):
#     def __contains__(self, mode):
#     def __getitem__(self, v):
#     def handle_event(self, event):
#     def tick(self):
#     def log_queue(self, log_level=logging.INFO):
# def tabularize(rows, col_spacing=2):


# Path: procgame/sound.py
import random
import time
import logging
import os.path
    import procgame
    import procgame.game.skeletongame
        import traceback
from procgame.game import mode
from collections import deque
from math import ceil
    from pygame import mixer # This call takes a while.

CH_MUSIC_2 = 3    # as above; note: these are useful if you want to pause music, start
                  # another song playing (other channel) and later resume that first track
                    # NOTE: using these channels will cause your music to be treated like _sounds_
                    # and that means they will be fully loaded into memory instead of streamed
                    # from the disk.  Unlike sounds pre-loaded with the assetManager, so unless they
                    # are registered as non-streaming, they will be loaded at playback time,
                    # which will introduce a delay

# this refers to all music channels which provides a default for
CH_ALL_MUSIC_CHANNELS = -2 # pause_music, unpause_music, stop_music, fadeout_music

# IF you add your own reserved channels, use numbers > 3 and < 8
# (num channels == 8 unless you change mixer.set_num_channels(8))
# example : CH_SPINNER = 4 # doing this would ensure that your spinner doesn't
#  eat all of your sound channels you would also need to add a
#  mixer.set_reserved(CH_SPINNER) in the __init__() below, and be sure that
#  whenever you play() the spinner effect, you do so on this CH_SPINNER channel

# PLAYBACK "Priorities" for VOICE playback
# PLAY_SIMULTANEOUS = 1   # STANDARD METHOD USING SHARED CHANNEL (CH_SFX)
PLAY_QUEUED = 2         # ADD TO QUEUED CHANNEL (CH_VOICE)
PLAY_FORCE = 3          # STOP ANY SOUNDS PLAYING AND PLAY THIS
PLAY_NOTBUSY= 4         # only play or queue if nothing is currently playing

DUCKED_MUSIC_PERCENT = 0.5    # drops the music volume to this percentage when ducking for voice lines
# it not enabled by default for asset_manager loadeds sounds
# (because the way the pygame queue works, it has to be enabled for all voice calls or no voice calls).
# enable (from game code) via:
#   self.sound.enable_music_ducking(True)


class SoundController(mode.Mode):  #made this a mode since I want to use delay feature for audio queuing