callback: Remove all references to callbacks

Callbacks have no remaining users and can safely be removed :)

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-04-04 10:17:28 -04:00
parent e4ea994728
commit c80468a739
11 changed files with 1 additions and 66 deletions

1
DESIGN
View File

@ -39,5 +39,4 @@ Core Layers:
* Index (include/core/index.h)
* Databases (include/core/database.h)
* File (include/core/file.h)
* Callbacks (include/core/callback.h)
* Version (include/core/version.h)

2
TODO
View File

@ -58,7 +58,6 @@ Future work:
the library? Perhaps create a mirror group?
- Extra testing ideas:
- Test callbacks
- Create a default main() that deletes data directory
- Preferences:
@ -90,7 +89,6 @@ Future work:
- Make DatabaseEntry::primary_key() private (only used by Database)
- "On demand" databases that load the first time they are accessed?
- Queues have their own indexes?
- Remove callbacks (may need "driver" for queues)
- Remove glib specifc code from core/
- Virtual file system
- Fake filesystem access for testing

View File

@ -1,19 +0,0 @@
/**
* @file
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/callback.h>
static void no_op(Queue *) {}
static struct Callbacks callbacks = {
.on_pq_removed = no_op,
};
struct Callbacks *get_callbacks()
{
return &callbacks;
}

View File

@ -2,7 +2,6 @@
* @file
* Copyright 2013 (c) Anna Schumaker.
*/
#include <core/callback.h>
#include <core/deck.h>
#include <core/file.h>
#include <core/library.h>
@ -136,7 +135,6 @@ Queue *deck :: create(bool random)
static void _destroy(std::list<TempQueue>::iterator &it)
{
get_callbacks()->on_pq_removed(&(*it));
queue_deck.erase(it);
deck :: write();
}

View File

@ -2,7 +2,6 @@
* @file
* Copyright 2013 (c) Anna Schumaker.
*/
#include <core/callback.h>
#include <core/queue.h>
#include <core/random.h>
#include <core/string.h>

View File

@ -1,7 +1,6 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/callback.h>
#include <core/deck.h>
#include <core/string.h>
#include <gui/tabs.h>

View File

@ -1,7 +1,6 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/callback.h>
#include <core/deck.h>
#include <core/filter.h>
#include <core/playlist.h>

View File

@ -1,36 +0,0 @@
/**
* @file
* Copyright 2014 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_CALLBACK_H
#define OCARINA_CORE_CALLBACK_H
#include <core/library.h>
#include <core/queue.h>
/**
* A structure for managing callback function pointers
*/
struct Callbacks {
/* Deck callbacks */
/**
* Called when a queue is removed.
*
* @param queue The queue that is being removed.
*/
void (*on_pq_removed)(Queue *);
};
/**
* Called to access the callbacks structure.
*
* @return The current struct Callbacks for this application.
*/
struct Callbacks *get_callbacks();
#endif /* OCARINA_CORE_CALLBACK_H */

View File

@ -24,7 +24,6 @@ test( "tags/track" )
test( "random" )
objs += [ get_test_obj("callback", "core") ]
objs += [ get_test_obj("tags/tags", "core") ]
test( "queue" )
test_env.UsePackage("taglib")

View File

@ -1,7 +1,6 @@
/*
* Copyright 2013 (c) Anna Schumaker.
*/
#include <core/callback.h>
#include <core/deck.h>
#include <core/library.h>
#include <core/tags/tags.h>

View File

@ -1,7 +1,6 @@
/*
* Copyright 2014 (c) Anna Schumaker.
*/
#include <core/callback.h>
#include <core/queue.h>
#include <core/random.h>
#include <core/tags/tags.h>
@ -31,6 +30,7 @@ class TestQueue : public Queue {
public:
TestQueue() : Queue() { set_notifier(&test_notifier); }
TestQueue(unsigned int f) : Queue(f) { set_notifier(&test_notifier); }
~TestQueue() {}
unsigned int get_cur() { return _cur; }
unsigned int get_flags() { return _flags; }
QNotifier *get_notify() { return _notify; }