pianod2
multisource multiuser scriptable networked music player
Classes | Namespaces | Functions | Variables
osxplayer.mm File Reference

OS X audio player. More...

#include <config.h>
#include <stdio.h>
#include <string>
#include <thread>
#include "fundamentals.h"
#include "logging.h"
#include "mediaplayer.h"
#include "audiooutput.h"
#include "osxplayer.h"
#import <AppKit/AppKit.h>
#import <AVFoundation/AVFoundation.h>
#import <Cocoa/Cocoa.h>
Include dependency graph for osxplayer.mm:

Classes

class  PianodAppDelegate
 
class  PlayerHelper
 Catch notifications that the player is ready or has completed. More...
 
class  Audio::AVFoundationPlayer
 Base class for OS X's AVFoundation audio player. More...
 

Namespaces

 Audio
 Classes dealing with audio output drivers and decoding/playing audio files.
 

Functions

void wrapInNSApplication (void real_application(void))
 The AVAudioPlayer works great, until end of song when it won't tell us that it's done. More...
 
Media::PlayerAudio::getAVFoundationPlayer (const AudioSettings &AudioSettings, const std::string &media_url, float initial_audio_gain)
 Old-style C interface to provide bridge from C++ to Objective-C compiled code. More...
 

Variables

static std::thread * thread = nullptr
 
static void(* real_app )(void)
 
AVPlayerItem * play_item
 
AVPlayer * play
 

Detailed Description

OS X audio player.

Play media files on OS X using AVFoundation framework.

Function Documentation

◆ wrapInNSApplication()

void wrapInNSApplication ( void   real_applicationvoid)

The AVAudioPlayer works great, until end of song when it won't tell us that it's done.

To get that, we need NSApplication and its main run loop going, and as a bonus, the fucker asserts if it's not the first thread.

Here is the caller graph for this function:

Variable Documentation

◆ play

AVPlayer* play

◆ play_item

AVPlayerItem* play_item
Initial value:
{
Base class for OS X's AVFoundation audio player.
Definition: osxplayer.mm:108

◆ real_app

void(* real_app) (void) ( void  )
static

◆ thread

std::thread* thread = nullptr
static