aboutsummaryrefslogtreecommitdiff
path: root/ViewModels/MainWindowViewModel.cs
blob: e1f86e368c25b5f6a5fd6f7a9f40f04dfecb5d77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Text;
using Gst;

namespace AleeAudioPlayer.ViewModels
{
    public class MainWindowViewModel : ViewModelBase
    {
        public string Greeting => "Welcome to Alee Audio Player!";

        public void PlayFunction(string[] args)
        {
            Application.Init(ref args);
            // Build the pipeline
            var pipeline = Parse.Launch("playbin uri=file:///home/andrew/Music/4616-werq-by-kevin-macleod.mp3");

            // Start playing
            pipeline.SetState(State.Playing);

            // Wait until error or EOS
            var bus = pipeline.Bus;
            var msg = bus.TimedPopFiltered (Constants.CLOCK_TIME_NONE, MessageType.Eos | MessageType.Error);

            // Free resources
            //pipeline.SetState (State.Null);
        }
    }
}