App-MHFS

 view release on metacpan or  search on metacpan

lib/App/MHFS.pm  view on Meta::CPAN

1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
my %fileitem = ('requestfile' => $requestfile);
my $currentsize;
if($self->{'method'} ne 'HEAD') {
    my $FH;
    if(! open($FH, "<", $requestfile)) {
        say "SLF: open failed";
        $self->Send404;
        return;
    }
    binmode($FH);
    my $st = stat($FH);
    if(! $st) {
        $self->Send404();
        return;
    }
    $currentsize = $st->size;
    $fileitem{'fh'} = $FH;
}
else {
    $currentsize = (-s $requestfile);
}

lib/App/MHFS.pm  view on Meta::CPAN

1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
# truncate to the [potentially] satisfiable end
if(defined $self->{'header'}{'_RangeEnd'}) {
    $self->{'header'}{'_RangeEnd'} = min($filelength-1,  $self->{'header'}{'_RangeEnd'});
}
 
# setup callback for retrieving current file size if we are following the file
if($fileitem{'fh'}) {
    if(! $done) {
        $get_current_size = sub {
            return stat($fileitem{'fh'})
        };
    }
 
    my $get_read_filesize = sub {
        my $maxsize = $get_max_size->();
        if(defined $self->{'header'}{'_RangeEnd'}) {
            my $rangesize = $self->{'header'}{'_RangeEnd'}+1;
            return $rangesize if($rangesize <= $maxsize);
        }
        return $maxsize;

lib/App/MHFS.pm  view on Meta::CPAN

3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
    use constant HAS_MHFS_XS => (eval "use MHFS::XS; 1");
    if(! HAS_MHFS_XS) {
        warn __PACKAGE__.": XS not available";
    }
}
 
# read the directory tree from desk and store
# this assumes filenames are UTF-8ish, the octlets will be the actual filename, but the printable filename is created by decoding it as UTF-8
sub BuildLibrary {
    my ($path) = @_;
    my $statinfo = stat($path);
    return undef if(! $statinfo);
    my $basepath = basename($path);
    my $utf8name = get_printable_utf8($basepath);
 
    if(!S_ISDIR($statinfo->mode)){
    return undef if($path !~ /\.(flac|mp3|m4a|wav|ogg|webm)$/);
        return [$basepath, $statinfo->size, undef, $utf8name];
    }
    else {
        my $dir;

lib/App/MHFS.pm  view on Meta::CPAN

4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
my ($cr) = $context->{'stdout'} =~ /^.*Content\-Range:\sbytes\s\d+\-\d+\/(\d+)/s;
if($cr) {
    say "cr $cr";
    $cl = $cr if($cr > $cl);
}
say "cl is $cl";
UNLOCK_WRITE($filename);
LOCK_WRITE($filename, $cl);
 
# make sure the file exists and within our parameters
my $st = stat($filename);
$st or return;
my $minsize = 16384;
$minsize = $cl if($cl < $minsize);
return if($st->size < $minsize);
say "sending, currentsize " . $st->size . ' totalsize ' . $cl;
 
# dont need to check the new data anymore
$context->{'on_stdout_data'} = undef;
$sendit->();
$request = undef;

share/public_html/static/music_inc/src/miniaudio.h  view on Meta::CPAN

5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
#ifdef MA_WIN32
#include <windows.h>
#else
#include <stdlib.h>     /* For malloc(), free(), wcstombs(). */
#include <string.h>     /* For memset() */
#include <sched.h>
#include <sys/time.h>   /* select() (used for ma_sleep()). */
#endif
 
#include <sys/stat.h>   /* For fstat(), etc. */
 
#ifdef MA_EMSCRIPTEN
#include <emscripten/emscripten.h>
#endif
 
#if !defined(MA_64BIT) && !defined(MA_32BIT)
#ifdef _WIN32
#ifdef _WIN64
#define MA_64BIT
#else

share/public_html/static/music_inc/src/miniaudio.h  view on Meta::CPAN

27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
version here since we can open it even when another process has control of the "/dev/audioN" device.
*/
for (iDevice = 0; iDevice < maxDevices; ++iDevice) {
    struct stat st;
    int fd;
    ma_bool32 isTerminating = MA_FALSE;
 
    ma_strcpy_s(devpath, sizeof(devpath), "/dev/audioctl");
    ma_itoa_s(iDevice, devpath+strlen(devpath), sizeof(devpath)-strlen(devpath), 10);
 
    if (stat(devpath, &st) < 0) {
        break;
    }
 
    /* The device exists, but we need to check if it's usable as playback and/or capture. */
     
    /* Playback. */
    if (!isTerminating) {
        fd = open(devpath, O_RDONLY, 0);
        if (fd >= 0) {
            /* Supports playback. */

share/public_html/static/music_inc/src/miniaudio.h  view on Meta::CPAN

42648
42649
42650
42651
42652
42653
42654
42655
42656
42657
42658
42659
42660
42661
42662
42663
42664
42665
42666
    MA_ASSERT(pInfo != NULL);
 
    (void)pVFS;
 
#if defined(_MSC_VER)
    fd = _fileno((FILE*)file);
#else
    fd =  fileno((FILE*)file);
#endif
 
    if (fstat(fd, &info) != 0) {
        return ma_result_from_errno(errno);
    }
 
    pInfo->sizeInBytes = info.st_size;
 
    return MA_SUCCESS;
}
#endif

share/public_html/static/music_worklet_inprogress/decoder/bin/_mhfscl.js  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var Module = (() => {
  var _scriptName = import.meta.url;
   
  return (
async function(moduleArg = {}) {
  var moduleRtn;
 
var Module=moduleArg;var readyPromiseResolve,readyPromiseReject;var readyPromise=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject});var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof im...
 
 
  return moduleRtn;
}
);
})();
export default Module;

share/public_html/static/music_worklet_inprogress/decoder/deps/miniaudio/miniaudio.h  view on Meta::CPAN

11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
#ifdef MA_WIN32
#include <windows.h>
#else
#include <stdlib.h>     /* For malloc(), free(), wcstombs(). */
#include <string.h>     /* For memset() */
#include <sched.h>
#include <sys/time.h>   /* select() (used for ma_sleep()). */
#include <pthread.h>
#endif
 
#include <sys/stat.h>   /* For fstat(), etc. */
 
#ifdef MA_EMSCRIPTEN
#include <emscripten/emscripten.h>
#endif
 
#if !defined(MA_64BIT) && !defined(MA_32BIT)
#ifdef _WIN32
#ifdef _WIN64
#define MA_64BIT
#else

share/public_html/static/music_worklet_inprogress/decoder/deps/miniaudio/miniaudio.h  view on Meta::CPAN

34666
34667
34668
34669
34670
34671
34672
34673
34674
34675
34676
34677
34678
34679
34680
34681
34682
34683
34684
34685
34686
version here since we can open it even when another process has control of the "/dev/audioN" device.
*/
for (iDevice = 0; iDevice < maxDevices; ++iDevice) {
    struct stat st;
    int fd;
    ma_bool32 isTerminating = MA_FALSE;
 
    ma_strcpy_s(devpath, sizeof(devpath), "/dev/audioctl");
    ma_itoa_s(iDevice, devpath+strlen(devpath), sizeof(devpath)-strlen(devpath), 10);
 
    if (stat(devpath, &st) < 0) {
        break;
    }
 
    /* The device exists, but we need to check if it's usable as playback and/or capture. */
 
    /* Playback. */
    if (!isTerminating) {
        fd = open(devpath, O_RDONLY, 0);
        if (fd >= 0) {
            /* Supports playback. */

share/public_html/static/music_worklet_inprogress/decoder/deps/miniaudio/miniaudio.h  view on Meta::CPAN

56934
56935
56936
56937
56938
56939
56940
56941
56942
56943
56944
56945
56946
56947
56948
56949
56950
56951
56952
    MA_ASSERT(pInfo != NULL);
 
    (void)pVFS;
 
#if defined(_MSC_VER)
    fd = _fileno((FILE*)file);
#else
    fd =  fileno((FILE*)file);
#endif
 
    if (fstat(fd, &info) != 0) {
        return ma_result_from_errno(errno);
    }
 
    pInfo->sizeInBytes = info.st_size;
 
    return MA_SUCCESS;
}
#endif



( run in 0.989 second using v1.01-cache-2.11-cpan-49f99fa48dc )