Exemplo n.º 1
0
    void ExportBusTrack(XmlElement parent, BusTrack busTrack)
    {
        Type          type     = busTrack.GetType();
        AudioBusTrack audioBus = null;
        VideoBusTrack videoBus = null;

        if (type.Name == "AudioBusTrack")
        {
            audioBus = (AudioBusTrack)busTrack;
        }
        else if (type.Name == "VideoBusTrack")
        {
            videoBus = (VideoBusTrack)busTrack;
        }
        XmlElement elt = AddChild(parent, type.Name);

        ChildString(elt, "Name", busTrack.Name);
        ChildObject(elt, "MediaType", busTrack.MediaType);
        ChildString(elt, "Description", busTrack.Description);
        if (null != audioBus)
        {
            ChildBoolean(elt, "Mute", audioBus.Mute);
            ChildBoolean(elt, "Solo", audioBus.Solo);
            ChildObject(elt, "PanType", audioBus.PanType);
        }
        else if (null != videoBus)
        {
            AddVideoColor(elt, "TopFadeColor", videoBus.TopFadeColor);
            AddVideoColor(elt, "BottomFadeColor", videoBus.BottomFadeColor);
            ChildBoolean(elt, "Bypass", videoBus.Bypass);
        }
        ExportEnvelopes(elt, busTrack.Envelopes);
        ExportEffects(elt, busTrack.Effects, (null != videoBus));
    }
Exemplo n.º 2
0
    void ImportBusTrack(XmlElement parent, BusTracks busTracks)
    {
        BusTrack      busTrack      = null;
        AudioBusTrack audioBusTrack = null;
        VideoBusTrack videoBusTrack = null;
        String        busName       = ChildString(parent, "Name");

        if (parent.Name == "AudioBusTrack")
        {
            if ((busName == "Master") || (busName == "Surround Master"))
            {
                audioBusTrack = (AudioBusTrack)busTracks[1];
            }
            else
            {
                audioBusTrack = new AudioBusTrack();
                busTracks.Add(audioBusTrack);
                if (audioBusTrack.Name != busName)
                {
                    throw new ApplicationException("bad audio bus track order");
                }
            }
            busTrack = (BusTrack)audioBusTrack;
            try { busTrack.Description = ChildString(parent, "Description"); } catch {}
            try { audioBusTrack.Mute = ChildBoolean(parent, "Mute"); } catch {}
            try { audioBusTrack.Solo = ChildBoolean(parent, "Solo"); } catch {}
            try { audioBusTrack.PanType = ChildPanType(parent, "PanType"); } catch {}
            ImportEffects(parent, busTrack.Effects, myVegas.AudioFX);
        }
        else if (parent.Name == "VideoBusTrack")
        {
            videoBusTrack = (VideoBusTrack)busTracks[0];
            busTrack      = (BusTrack)videoBusTrack;
            ImportEffects(parent, busTrack.Effects, myVegas.VideoFX);
        }
        ImportEnvelopes(parent, busTrack.Envelopes);
    }