Beispiel #1
0
        public ControlPanel(SignalsWindow _signalsWindow)
        {
            InitializeComponent();
            signalsWindow = _signalsWindow;
            waverly       = signalsWindow.waverly;

            isPlaying   = false;
            isPaused    = false;
            isRecording = false;
        }
Beispiel #2
0
        public int trackWidth;     //width of data portion of track view for horizontal scrolling in pixels

        public TrackPanel(SignalsWindow _signalsWindow)
        {
            signalsWindow = _signalsWindow;
            project       = null;
            InitializeComponent();

            ruler       = new TrackRuler(this);
            ruler.Width = this.Width;
            ruler.Dock  = DockStyle.Top;
            Controls.Add(ruler);

            tracks       = new List <TrackView>();
            zoomfactor   = ZOOMFACTOR;
            tracksHeight = 10;          //bottom gutter
            trackWidth   = 0;
        }
Beispiel #3
0
        public MixerWindow(SignalsWindow _signalsWindow)
        {
            signalsWindow = _signalsWindow;
            project       = null;
            InitializeComponent();

            //mix master goes on right of mixer window
            mixmaster      = new MixerMaster(this);
            mixmaster.Dock = DockStyle.Right;
            this.Controls.Add(mixmaster);

            //strip scroll bar runs along bottom of window under channel strips
            stripScroll               = new HScrollBar();
            stripScroll.Minimum       = 0;
            stripScroll.Location      = new Point(0, MixerStrip.STRIPHEIGHT);
            stripScroll.Size          = new Size(MixerStrip.STRIPWIDTH, 20);
            stripScroll.LargeChange   = MixerStrip.STRIPWIDTH / 2;
            stripScroll.ValueChanged += new EventHandler(stripScroll_ValueChanged);
            this.Controls.Add(stripScroll);

            //strip panel contains the channel strips
            stripPanel          = new Panel();
            stripPanel.Location = new Point(0, 0);
            stripPanel.Size     = new Size(0, 0);
            stripPanel.TabStop  = false;
            this.Controls.Add(stripPanel);

            mixerStrips = new List <MixerStrip>();
            stripCount  = 0;

            //fix height & width for initial one strip view
            this.ClientSize  = new Size(mixmaster.Width + MixerStrip.STRIPWIDTH, MixerStrip.STRIPHEIGHT + stripScroll.Height);
            this.MinimumSize = new Size(this.Width, this.Height);

            addMixerStrip(null);
            addMixerStrip(null);
            addMixerStrip(null);
            addMixerStrip(null);
            addMixerStrip(null);
            addMixerStrip(null);
        }
Beispiel #4
0
//- track I/O -----------------------------------------------------------------

        static public X1Project open(SignalsWindow signalsWindow, String filename)
        {
            X1Project  newProject = null;
            FileStream infile     = File.Open(filename, FileMode.Open, FileAccess.Read);

            byte[] inbuf = new byte[12];
            infile.Read(inbuf, 0, 12);
            String sig     = Encoding.ASCII.GetString(inbuf, 0, 4);
            int    version = BitConverter.ToInt32(inbuf, 4);
            int    hdrSize = BitConverter.ToInt32(inbuf, 8);

            inbuf = new byte[hdrSize];
            infile.Read(inbuf, 0, hdrSize);
            int    projectNameLen = BitConverter.ToInt32(inbuf, 0);
            String _projectName   = Encoding.ASCII.GetString(inbuf, 4, projectNameLen);
            int    hdrOfs         = projectNameLen + 4;
            int    _sampleRate    = BitConverter.ToInt32(inbuf, hdrOfs);
            int    _duration      = BitConverter.ToInt32(inbuf, hdrOfs + 4);
            int    dataSize       = BitConverter.ToInt32(inbuf, hdrOfs + 8);
            float  _leftOutLevel  = BitConverter.ToSingle(inbuf, hdrOfs + 12);
            float  _rightOutLevel = BitConverter.ToSingle(inbuf, hdrOfs + 16);
            int    trackCount     = BitConverter.ToInt32(inbuf, hdrOfs + 20);

            newProject = new X1Project(signalsWindow, _projectName, _sampleRate, _duration);
            newProject.setLeftOutLevel(_leftOutLevel);
            newProject.setRightOutLevel(_rightOutLevel);
            newProject.filename = filename;

            int    trackDataPos = hdrOfs + 24;
            IntPtr inhdl        = infile.SafeFileHandle.DangerousGetHandle();

            for (int tracknum = 0; tracknum < trackCount; tracknum++)
            {
                trackDataPos = X1Track.loadTrack(newProject, inbuf, trackDataPos, inhdl);
            }

            return(newProject);
        }
Beispiel #5
0
//-----------------------------------------------------------------------------

        //cons
        public X1Project(SignalsWindow _signalsWindow, String _name, int _sampleRate, int _duration)
        {
            signalsWindow = _signalsWindow;
            waverly       = signalsWindow.waverly;
            mixerWindow   = signalsWindow.mixerWindow;
            mixerMaster   = signalsWindow.mixerWindow.mixmaster;
            trackPanel    = signalsWindow.trackPanel;

            projectName = _name;
            filename    = null;

            sampleRate = _sampleRate;
            duration   = _duration;
            dataSize   = sampleRate * duration;

            leftOutLevel  = 1.0f;
            rightOutLevel = 1.0f;

            tracks    = new List <X1Track>();
            isChanged = true;                              //work out a better determinization of when the project's changes later

            waverly.newAudioProject(sampleRate, duration); //create new project in back end
        }