## PhoshMediaPlayer

PhoshMediaPlayer — A simple MPRIS media player widget

## Functions

GtkWidget * | phosh_media_player_new ()
gboolean | phosh_media_player_get_is_playable ()
PhoshMediaPlayerStatus | phosh_media_player_get_status ()
void | phosh_media_player_toggle_play_pause ()

## Properties

gboolean | attached | Read
gboolean | playable | Read

## Signals

void | player-raised | Run Last

## Types and Values

enum | PhoshMediaPlayerStatus
#define | PHOSH_TYPE_MEDIA_PLAYER
| PhoshMediaPlayer

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkGrid
                        ╰── PhoshMediaPlayer

## Implemented Interfaces

PhoshMediaPlayer implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Description

The PhoshMediaPlayer widget interfaces with org.mpris.MediaPlayer2 based players allowing to skip through music and raising the player.

Whenever a player is found on the bus the “attached” property is set to `TRUE`. This can e.g. be used with ``g_object_bind_property()`` to toggle the widget's visibility.

### Example

    1
    2
    3

    <object class="PhoshMediaPlayer" id="media_player">
      <property name="visible" bind-source="media_player" bind-property="attached" bind-flags="sync-create"/>
    </object>

## Functions

### phosh_media_player_new ()

    GtkWidget *
    phosh_media_player_new (void);

### phosh_media_player_get_is_playable ()

    gboolean
    phosh_media_player_get_is_playable (PhoshMediaPlayer *self);

### phosh_media_player_get_status ()

    PhoshMediaPlayerStatus
    phosh_media_player_get_status (PhoshMediaPlayer *self);

### phosh_media_player_toggle_play_pause ()

    void
    phosh_media_player_toggle_play_pause (PhoshMediaPlayer *self);

## Types and Values

### enum PhoshMediaPlayerStatus

The status of the media player attached to the wigget

#### Members

PHOSH_MEDIA_PLAYER_STATUS_STOPPED | The player is stopped. |
PHOSH_MEDIA_PLAYER_STATUS_PAUSED | The player is paused. |
PHOSH_MEDIA_PLAYER_STATUS_PLAYING | The player is playing. |

### PHOSH_TYPE_MEDIA_PLAYER

    #define PHOSH_TYPE_MEDIA_PLAYER (phosh_media_player_get_type ())

### PhoshMediaPlayer

    typedef struct _PhoshMediaPlayer PhoshMediaPlayer;

## Property Details

### The `“attached”` property

      “attached”                 gboolean

Whether a player is attached.

Owner: PhoshMediaPlayer

Flags: Read

Default value: FALSE

### The `“playable”` property

      “playable”                 gboolean

Whether the player has a playable track. This is mostly useful to ignore states where the player does not know about any track and so no sensible information can be shown.

Owner: PhoshMediaPlayer

Flags: Read

Default value: FALSE

## Signal Details

### The `“player-raised”` signal

    void
    user_function (PhoshMediaPlayer *phoshmediaplayer,
                   gpointer          user_data)

The player was raised to the user

#### Parameters

user_data | user data set when the signal handler was connected. |

Flags: Run Last