Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 84 lines (67 sloc) 2.673 kB
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
1 // -*- c++ -*-
4d4d90b @hzeller o More legalese
authored
2 // Folve - A fuse filesystem that convolves audio files on-the-fly.
3 //
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
4 // Copyright (C) 2012 Henner Zeller <h.zeller@acm.org>
b4eec5c @hzeller o libboost caused too many troubles in embedded systems with weak
authored
5 //
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18
a9d3e53 @hzeller o Found a project name: "Folve". Some renamings because of that.
authored
19 #ifndef FOLVE_STATUS_SERVER_H
20 #define FOLVE_STATUS_SERVER_H
223f392 @hzeller o Have a separate HandlerStats object that contains relevant
authored
21
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
22 #include <string>
223f392 @hzeller o Have a separate HandlerStats object that contains relevant
authored
23 #include <deque>
24
25 #include "file-handler-cache.h"
26 #include "file-handler.h"
b4eec5c @hzeller o libboost caused too many troubles in embedded systems with weak
authored
27 #include "util.h"
1e9ff21 @hzeller o main: report if parameters are not directories.
authored
28
a9d3e53 @hzeller o Found a project name: "Folve". Some renamings because of that.
authored
29 class FolveFilesystem;
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
30 struct MHD_Daemon;
31 struct MHD_Connection;
32
223f392 @hzeller o Have a separate HandlerStats object that contains relevant
authored
33 class StatusServer : protected FileHandlerCache::Observer {
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
34 public:
b5c1e96 @hzeller o more useful output on status server.
authored
35 // Does not take over ownership of the filesystem.
a9d3e53 @hzeller o Found a project name: "Folve". Some renamings because of that.
authored
36 StatusServer(FolveFilesystem *fs);
44ff5c4 @hzeller o some cleanup.
authored
37 virtual ~StatusServer(); // Shut down daemon.
a9d3e53 @hzeller o Found a project name: "Folve". Some renamings because of that.
authored
38
39 // Start server, listing on given port.
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
40 bool Start(int port);
41
a372a03 @hzeller o Make meta-refresh configurable.
authored
42 // Set browser meta-refresh time. < 0 to disable.
43 void set_meta_refresh(int seconds) { meta_refresh_time_ = seconds; }
44
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
45 private:
44ff5c4 @hzeller o some cleanup.
authored
46 // micro-httpd callback
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
47 static int HandleHttp(void* user_argument,
48 struct MHD_Connection *,
49 const char *, const char *, const char *,
50 const char *, size_t *, void **);
51
118a454 @hzeller o Show the filter used for a particular format.
authored
52 const std::string &CreatePage();
44ff5c4 @hzeller o some cleanup.
authored
53
118a454 @hzeller o Show the filter used for a particular format.
authored
54 // Some helper functions to create the page:
d280fce @hzeller o Reload page with a meta-refresn.
authored
55 void AppendSettingsForm();
118a454 @hzeller o Show the filter used for a particular format.
authored
56 void AppendFileInfo(const char *progress_style, const HandlerStats &stats);
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
57
249865a @hzeller o Make debug mode switchable in UI.
authored
58 // Set filter or debug mode from http-request. Gracefully handles garbage.
a372a03 @hzeller o Make meta-refresh configurable.
authored
59 void SetFilter(const char *value);
60 void SetDebug(const char *value);
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
61
20e139c @hzeller o Less cluttered output in UI if -D is not set.
authored
62 // Show details that might only be interesting while setting up things.
63 bool show_details();
64
223f392 @hzeller o Have a separate HandlerStats object that contains relevant
authored
65 // -- interface FileHandlerCache::Observer
66 virtual void InsertHandlerEvent(FileHandler *handler) {}
67 virtual void RetireHandlerEvent(FileHandler *handler);
b4eec5c @hzeller o libboost caused too many troubles in embedded systems with weak
authored
68
223f392 @hzeller o Have a separate HandlerStats object that contains relevant
authored
69 typedef std::deque<HandlerStats> RetiredList;
70 RetiredList retired_;
1e9ff21 @hzeller o main: report if parameters are not directories.
authored
71 int expunged_retired_;
b4eec5c @hzeller o libboost caused too many troubles in embedded systems with weak
authored
72 folve::Mutex retired_mutex_;
1e9ff21 @hzeller o main: report if parameters are not directories.
authored
73
223f392 @hzeller o Have a separate HandlerStats object that contains relevant
authored
74 double total_seconds_filtered_;
75 double total_seconds_music_seen_;
a372a03 @hzeller o Make meta-refresh configurable.
authored
76 int meta_refresh_time_;
a9d3e53 @hzeller o Found a project name: "Folve". Some renamings because of that.
authored
77 FolveFilesystem *filesystem_;
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
78 struct MHD_Daemon *daemon_;
7d695c6 @hzeller o Rename current_page_ to content_ to be more generic.
authored
79 std::string content_;
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
80 bool filter_switched_;
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
81 };
223f392 @hzeller o Have a separate HandlerStats object that contains relevant
authored
82
a9d3e53 @hzeller o Found a project name: "Folve". Some renamings because of that.
authored
83 #endif // FOLVE_STATUS_SERVER_H
Something went wrong with that request. Please try again.