Example #1
0
 def list_markers(self):
     """
     cat: info
     desc: list the markers in this controller
     """
     info_title("Controller for {0}".format(self.reltype))
     info_list(list(self.markers.values()))
Example #2
0
    def init_mode(self):
        """
        fill in initialization via input
        get recording by mode
        call get_help/playback if asked
        returns rec array
        """
        valid_modes = (
            "live Record (R)", 
            "read from File (F)", 
            "relativism project or sampler Object (O)", 
            "Help (H)"
        )
        info_title("Available modes:")
        info_list(valid_modes)
        p("Enter desired mode's letter")
        mode = inpt('letter', allowed='rfh')

        # Record Mode
        if mode == "r":
            self.record_live()
        # File Mode
        elif mode == "f":
            self.read_file()
        elif mode == "o":
            raise NotImplementedError
        # Help
        elif mode == "h":
            raise NotImplementedError
Example #3
0
 def list_children(self):
     """
     cat: info
     """
     info_block("Children in '{0}':".format(self.name))
     children = ["{0} ({1})".format(i.name, i.reltype) for i in self.children]
     info_list(children)
Example #4
0
 def show(self):
     """
     like repr but prints directly
     """
     info_line("Sourced from {0} '{1}':".format(self.s_type, self.s_name))
     for k, v in self.s_info.items():
         info_list("{0}: {1}".format(k, v))
Example #5
0
 def list_projects(self):
     info_title("Existing projects:")
     for k, v in self.projects.items():
         if v == "None":
             info_list(k + " (Not found)")
         else:
             info_list(k)
Example #6
0
 def display(self):
     message = self.name.capitalize()
     message += ": " + self.desc
     if len(self.aliases) > 0:
         message += " (alias"
         if len(self.aliases) > 1:
             message += "es"
         message += ": '" + "', '".join(self.aliases) + "')"
     info_list(message, hang=4)
     self.display_args()
Example #7
0
 def show_settings():
     info_title("Settings:")
     attrs = [attr for attr in dir(_SettingsContainer) if "__" not in attr and attr != "_defaults"]
     maxlen = max(len(i) for i in attrs)
     for name in attrs:
         value = getattr(_SettingsContainer, name)
         if value == True:
             value = "On"
         if value == False:
             value = "Off"
         info_list(name + ": " + (" " * abs(maxlen - len(name))) + str(value))
Example #8
0
 def see_proj(self, proj_name, proj_path):
     info_block("Previewing Project '{0}'".format(proj_name))
     fullpath = join_path(
         proj_path,
         proj_name + ".Project." + RelSavedObj.datafile_extension)
     with open(fullpath, "r") as f:
         data = json.load(f)
     info_title("Path: " + data["path"])
     info_line("Audio file: " + str(data["file"]))
     info_line("Children:")
     children = [
         re.sub(r"<.*>", "", i).split(".") for i in data["children"]
     ]
     children = ["{0} '{1}'".format(i[1], i[0]) for i in children]
     info_list(children)
Example #9
0
 def list_active(self):
     """
     desc: list active pairs in this sampler
     cat: info
     dev:
         returns bool, false if nothing to list
     """
     info_title("Active pairs in '{0}':".format(self.name))
     empty = True
     for a in self.active:
         info_list(str(a))
         empty = False
     if empty:
         info_list("No active pairs created")
         return False
Example #10
0
 def list_rhythms(self):
     """
     desc: list rhythms in this sampler
     cat: info
     dev:
         returns bool, false if nothing to list
     """
     print("\n  Rhythms loaded into '{0}':".format(self.name))
     empty = True
     for obj in self.rhythms:
         empty = False
         info_list(str(obj))
     if empty:
         info_block("No rhythms loaded")
         return False
Example #11
0
 def list_samples(self):
     """
     desc: list samples in this sampler
     cat: info
     dev:
         returns bool, false if nothing to list
     """
     print("\n  Samples loaded into '{0}':".format(self.name))
     empty = True
     for obj in self.smps:
         info_list(str(obj))
         empty = False
     if empty:
         info_block("No samples loaded")
         return False
Example #12
0
 def process():
     section_head("Editing User Settings")
     method_strs = [func for func in dir(Settings) if "__" not in func and 
         is_public_process(getattr(Settings, func))]
     while True:
         info_title("Available processes:")
         info_list(method_strs)
         p("What process to run?")
         proc = inpt("alphanum")
         try:
             proc = autofill(proc, method_strs)
             method = getattr(Settings, proc)
             if is_public_process(method):
                 method()
             else:
                 raise AttributeError
         except AutofillError as e:
             err_mess("No process matches '{0}'!".format(e.word))
         except AttributeError:
             err_mess("No process matches '{0}'!".format(proc))
Example #13
0
 def list_samples(self):
     info_title("Samples in Sample Group '{0}':".format(self.name))
     info_list(list(self.samples.keys()))