Skip to content

stengerh/foo_catnap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTful API for foobar2000

Default port: 20402 = 0x4FB2

Implemented endpoints:

  • / [GET, server availability check]
  • /playback/events [GET, HTML5 Server-Sent Events, playback state changes]
  • /playlists [GET]
  • /playlists/events [GET, HTML5 Server-Sent Events, hard-coded dummy data]

See test.html for basic functionality tests.

Source Structure

The component consists of the following modules.

  • Core: Contains foobar2000 service implementations, e.g component version information and life cycle listeners.
  • Requests: Contains request handler implementations.
  • Bridge: Mediates between the foobar2000 and the Poco world.

The main reason for this structure is the incompatiblity between Winsock version 1 and 2. Unfortunately, foobar2000 uses Winsock version 1 and Poco::Net uses Winsock version 2. Therefore some care must be taken to not include foobar2000 SDK headers and Poco::Net headers in the same compilation unit. The table below shows which includes are allowed in each module.

Module Allowed includes for header files Allowed includes for implementation files
Core foobar2000 SDK
Poco excluding Poco::Net
Bridge
foobar2000 SDK
Poco excluding Poco::Net
Bridge
Requests Poco including Poco::Net Poco including Poco::Net
Bridge
Bridge Poco excluding Poco::Net Poco excluding Poco::Net
foobar2000 SDK
Poco including Poco::Net
Requests

The implementation files in the Bridge module are split into two categories. The proper thing to do would be to split the Bridge module into two modules. However there is only one implementation file at the moment which falls into the second category (for the main server class).

Links