# Path: pygesture/filestruct.py
# def new_session_dir(rootdir, pid, sid):
# def get_recording_dir(session_dir):
# def get_processed_dir(session_dir):
# def get_log_dir(session_dir):
# def get_recording_file(recording_dir, pid, sid, date_str, trial_num,
#                        label=None):
# def get_log_file(log_dir, pid, sid, date_str, trial_num):
# def find_session_dir(rootdir, pid, sid):
# def new_feature_file(session_dir, pid, sid, date_string):
# def find_feature_file(rootdir, pid, sid):
# def get_participant_list(rootdir):
# def get_session_list(rootdir, pid, search=""):
# def get_feature_file_list(rootdir, pid, sid_list):
# def get_recording_file_list(recording_dir):
# def get_log_file_list(log_dir):
# def parse_date_string(name):
# def parse_trial_number(name):
# def parse_label(name):
# 
# Path: pygesture/wav.py
# def write(filename, rate, data):
# def read(filename):
#     def __init__(self, filename, fs):
#     def write(self, data):
#     def close(self):
# class ContinuousWriter(object):


import os
import numpy as np
from multiprocessing import Pool
from pygesture import filestruct
from pygesture import wav
    filename : str
        Name of the WAV file (name only, no path).
    raw_data : array, shape (n_samples, n_channels)
        Raw data as read from the WAV file.
    trial_number : int
        Trial number of the recording (pertains to the session it was recorded
        in).
    label : int
        Label of the recording as a whole, relevant to recordings in which a
        gesture is held throughout.
    conditioned_data : array, shape (n_samples_conditioned, n_channels)
        Raw data that has been transformed by the conditioner (of the input
        processor)
    feature_data : array, shape (n_windows, n_features+1)
        Feature data with the label of the recording in the first column. If
        rest bounds are given in the processor, the first rows of the feature
        data will be rest data, and the remaining portion will be from the
        gesture bounds given in the processor.
    """
    def __init__(self, wavfile, processor):
        self.wavfile = wavfile
        self.processor = processor

        self._conditioner = self.processor.conditioner
        self._feature_extractor = self.processor.feature_extractor
        self._windower = self.processor.windower

        self._read_file()

    def _read_file(self):

# Path: pygesture/filestruct.py
# def new_session_dir(rootdir, pid, sid):
# def get_recording_dir(session_dir):
# def get_processed_dir(session_dir):
# def get_log_dir(session_dir):
# def get_recording_file(recording_dir, pid, sid, date_str, trial_num,
#                        label=None):
# def get_log_file(log_dir, pid, sid, date_str, trial_num):
# def find_session_dir(rootdir, pid, sid):
# def new_feature_file(session_dir, pid, sid, date_string):
# def find_feature_file(rootdir, pid, sid):
# def get_participant_list(rootdir):
# def get_session_list(rootdir, pid, search=""):
# def get_feature_file_list(rootdir, pid, sid_list):
# def get_recording_file_list(recording_dir):
# def get_log_file_list(log_dir):
# def parse_date_string(name):
# def parse_trial_number(name):
# def parse_label(name):
# 
# Path: pygesture/wav.py
# def write(filename, rate, data):
# def read(filename):
#     def __init__(self, filename, fs):
#     def write(self, data):
#     def close(self):
# class ContinuousWriter(object):


# Path: pygesture/analysis/processing.py
import os
import numpy as np
from multiprocessing import Pool
from pygesture import filestruct
from pygesture import wav

    filename : str
        Name of the WAV file (name only, no path).
    raw_data : array, shape (n_samples, n_channels)
        Raw data as read from the WAV file.
    trial_number : int
        Trial number of the recording (pertains to the session it was recorded
        in).
    label : int
        Label of the recording as a whole, relevant to recordings in which a
        gesture is held throughout.
    conditioned_data : array, shape (n_samples_conditioned, n_channels)
        Raw data that has been transformed by the conditioner (of the input
        processor)
    feature_data : array, shape (n_windows, n_features+1)
        Feature data with the label of the recording in the first column. If
        rest bounds are given in the processor, the first rows of the feature
        data will be rest data, and the remaining portion will be from the
        gesture bounds given in the processor.
    """
    def __init__(self, wavfile, processor):
        self.wavfile = wavfile
        self.processor = processor

        self._conditioner = self.processor.conditioner
        self._feature_extractor = self.processor.feature_extractor
        self._windower = self.processor.windower

        self._read_file()

    def _read_file(self):

        self.fs_raw, self.raw_data = wav.read(self.wavfile)