220 26230 <83016a47-e902-4292-b109-652e811d17fb@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: alexander.zywicki@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Any interest to adding audio support to the std library?
Date: Thu, 9 Jun 2016 21:30:01 -0700 (PDT)
Lines: 177
Approved: news@gmane.org
Message-ID: <83016a47-e902-4292-b109-652e811d17fb@isocpp.org>
References: <5751B06A.4080501@mail1.stofanet.dk> <5290948.va25uYNizX@tjmaciei-mobl1>
 <CAEhD+6Ca=j3SaS5nC_Qe=6FGMdJLgpQd1LnGfiep8m9GrEU1jQ@mail.gmail.com>
 <1580229.cHEgQxCuA1@tjmaciei-mobl1> <CANh-dX=heKaWzvE+rk8FeCSTQyZ8-FR9UaGdam8quLaEuLJ=-A@mail.gmail.com>
 <62b7649a-5de5-4330-9bac-708375d36e2c@isocpp.org>
 <CAOcFa=fnWS=T2p6xgQ_EiCnVTmkSk_UrobDMYvXhaKi95cxrdQ@mail.gmail.com>
 <3c0fde91-671d-4751-955d-7b04cfa120bc@isocpp.org>
 <4922d8b8-7909-44a2-a24f-8dcf4090911f@isocpp.org>
 <fa20d105-71df-445b-a773-6de77ece5c09@isocpp.org>
 <f5465abe-f7e5-45c5-aa0b-92d5727bbfa6@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_614_821088863.1465533001769"
X-Trace: ger.gmane.org 1465533007 2979 80.91.229.3 (10 Jun 2016 04:30:07 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 10 Jun 2016 04:30:07 +0000 (UTC)
Cc: alexander.zywicki@gmail.com, ross.bencina@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCS7TY6DTQOBBS4E5G5AKGQEHXESHAQ@isocpp.org Fri Jun 10 06:30:06 2016
Return-path: <std-proposals+bncBCS7TY6DTQOBBS4E5G5AKGQEHXESHAQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f197.google.com ([209.85.223.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCS7TY6DTQOBBS4E5G5AKGQEHXESHAQ@isocpp.org>)
	id 1bBE56-0005Ct-Lr
	for gclcip-std-proposals@m.gmane.org; Fri, 10 Jun 2016 06:30:04 +0200
Original-Received: by mail-io0-f197.google.com with SMTP id 5sf83990476ioy.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 09 Jun 2016 21:30:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=X3qHAogN5t+vKBfbognL3WDoVGEXW7y4ubYC6eX3zM0=;
        b=ehGOGr7eiDAn+sORFbKAH3Ru64vhxkVsLiH6QYYh1h2y7cfLIkXPTKdfuZ2DCAu+su
         whsWiM7Gvd8oTdlaXvhEhmc/V6uZtgw5ScEb7ypJBpvMwvErlKE7gdG6NAHwnkfPNHXS
         mNizam8BJNTfy95hMtyFdP33L2vgjhwT87INNzeozyK0+eLQ8r+hMKPd3bQXtzE/iDmu
         HuwEL3c9uw8riRUhZ/jPGlagBwRkg4LKWMkU0BRC3ALAHyHhtrzka58L2FtBOVmT9N9y
         6lW/ZXF26SSLtcM/uoW7xnEhlCOsxf32rjICV3U5w2CDf+ZmMHwMnfhRas+dcn84EdHS
         2Lig==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=X3qHAogN5t+vKBfbognL3WDoVGEXW7y4ubYC6eX3zM0=;
        b=g7Pv1RB3HAdXGq61+Y49Ra/lBmX6Raj8t5qEqK940swVa4cIXDTG0L0eKW3Rhqchns
         oMz0D8J8fChjhFvoOlRGq5WCzkSaMCKtvuxPTGDt1kkfd7KzKlKCPY5NHzYVcE1Jbxe4
         UsL1WLg4K4vlv7JoYTAOe0P0fZN9LDq8ulrfs5R0NhpKDfpHzma1lv3IbmEdbyA8Ldk3
         X/lKFDs6TKjxpn+/9XlMkstConfwvHwjJVzV7EbA+TV1RAR7eGLv5spcJZF8b3PH4Y/P
         WOMVj4MQwE3Zn9rmCAr2y6fiuAhpMA6Edy/h0v8abeiSUeuCSWWtW/KS7LeZcLurvEG4
         jxSA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=X3qHAogN5t+vKBfbognL3WDoVGEXW7y4ubYC6eX3zM0=;
        b=i/5rPglwvwTD/kZznFqvM6jgy1jLb9SBFolEffzIM4g3+0GVdFcRUdi9yb0EAxTp7d
         +MNNzFnOewDxjelQ5s0qaluHTZQa+GRA1UlSJL/lg9lYk2WYZQjxeFfSnTmrrYh1naXm
         RylegT1SvGLTS1SMCS/55UK6QyBhYxQs79w5+kZFfOXRI8GxE9eyx0oMOv5WfiO8s/Ln
         g7bokzRfSSeYc6EZUEv1Srjp/igmxbWvcINBNd21Oe8POEMOojP9oMRt5P0BU+nXQLZv
         do/pO/7eHkG9QxWrZC/k2NTePdWxkHDH0SD58rrscYdbiL+Cavs2x1nvHxQXrPS3sjvH
         xUaw==
X-Gm-Message-State: ALyK8tLSnZRdvtVzds+y1oYbu846E0UAcXpRV76wHIeEET2n5KNhDu5Mv8V2OKIVLgvUgw==
X-Received: by 10.157.60.124 with SMTP id j57mr1405ote.26.1465533003616;
        Thu, 09 Jun 2016 21:30:03 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.32.16 with SMTP id g16ls660356iog.52.gmail; Thu, 09 Jun
 2016 21:30:02 -0700 (PDT)
X-Received: by 10.36.20.206 with SMTP id 197mr617645itg.3.1465533002856;
        Thu, 09 Jun 2016 21:30:02 -0700 (PDT)
In-Reply-To: <f5465abe-f7e5-45c5-aa0b-92d5727bbfa6@isocpp.org>
X-Original-Sender: alexander.zywicki@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:26230
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26230>

------=_Part_614_821088863.1465533001769
Content-Type: multipart/alternative; 
	boundary="----=_Part_615_1940005619.1465533001770"

------=_Part_615_1940005619.1465533001770
Content-Type: text/plain; charset=UTF-8

I suppose we could use the std::chrono library as a basis, and define a 
clock type that has a dynamically set epoch. This would allow a time-point 
to have a value relative to when the stream was started? 

So maybe the introduction of:

std::audio::sample_clock;//a clock type that counts in frames(or samples)
/*
-has internal member of "rate" that is used for conversion
-keeps track of number of frames(or samples) elapsed
-can produce a time_point that is a real number of seconds from epoch.
-epoch can be reset
-clock will be synced with hardware??? if possible?? or good idea??

*/
std::chrono::time_point<std::audio::sample_clock> foo;//the current time 
since epoch in seconds





On Thursday, June 9, 2016 at 10:05:08 PM UTC-5, Ron wrote:
>
>
> On Thursday, June 9, 2016 at 7:26:37 PM UTC-7, alexande...@gmail.com 
> wrote:
>>
>> Do you have any suggestions as far as an explicit notion of time should 
>> be in this context?
>>
>
> As a suggestion, something I usually use is a start and end to the buffer 
> and the rate of the buffer.  Basically a class that has a value equal to 
> the start frame of the given buffer, a value equal to the end frame of the 
> buffer (or start of next frame) and a value equal to the frame rate.  So 
> you can derive a real for each, like start frames over frame rate and end 
> frame over frame rate.  From that you can get the seconds as a double or 
> long double.
>
> class frame_ticks  // or some name that better describes this...
> {
>     uint64_t fstart;
>     uint64_t fend;
>     uint64_t frate;
>     // ...
> };
>
> Allowing the start value to be set or reset on starting or stopping 
> record/playback is another feature that some might need here.  And I 
> don't recommend eliminating the rate portion from this class since it could 
> lead to trouble where people are making assumptions they shouldn't, best to 
> have them together.
>
> Also, I would not add other data to this class since it could be re-used 
> elsewhere as is.  Other properties of a buffer can be defined in another 
> class/structure, but again this is just a suggestion...
>
>

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/83016a47-e902-4292-b109-652e811d17fb%40isocpp.org.

------=_Part_615_1940005619.1465533001770
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I suppose we could use the std::chrono library as a basis,=
 and define a clock type that has a dynamically set epoch. This would allow=
 a time-point to have a value relative to when the stream was started? <br>=
<br>So maybe the introduction of:<br><span style=3D"color: #000;" class=3D"=
styled-by-prettify"></span><br><span style=3D"color: #000;" class=3D"styled=
-by-prettify"></span><div class=3D"prettyprint" style=3D"background-color: =
rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; =
border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div=
 class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">std</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">audio<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">sample_clock</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span sty=
le=3D"color: #800;" class=3D"styled-by-prettify">//a clock type that counts=
 in frames(or samples)</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br></span><span style=3D"color: #800;" class=3D"styled-by-pret=
tify">/*<br>-has internal member of &quot;rate&quot; that is used for conve=
rsion<br>-keeps track of number of frames(or samples) elapsed<br>-can produ=
ce a time_point that is a real number of seconds from epoch.<br>-epoch can =
be reset<br>-clock will be synced with hardware??? if possible?? or good id=
ea??</span><span style=3D"color: #800;" class=3D"styled-by-prettify"><br><b=
r>*/</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>st=
d</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify">chrono</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">time_point</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">std</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">audio</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify">sample_clock</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> foo</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">;</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//the =
current time since epoch in seconds</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br><br><br></span></div></code></div><br><br><br>=
On Thursday, June 9, 2016 at 10:05:08 PM UTC-5, Ron wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr"><br>On Thursday, June 9, 2016 =
at 7:26:37 PM UTC-7, <a>alexande...@gmail.com</a> wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr">Do you have any suggestions as far =
as an explicit notion of time should be in this context?</div></blockquote>=
<div><br></div><span style=3D"font-family:arial,sans-serif;font-size:small"=
>As a suggestion, something I usually use is a start and end to the buffer =
and the rate of the buffer. =C2=A0Basically a class that has a value equal =
to the start frame of the given buffer, a value equal to the end frame of t=
he buffer (or start of next frame) and a value equal to the frame rate. =C2=
=A0So you can derive a real for each, like start frames over frame rate and=
 end frame over frame rate. =C2=A0From that you can get the seconds as a do=
uble or long double.</span><div style=3D"font-family:arial,sans-serif;font-=
size:small"><br></div><div style=3D"border:1px solid rgb(187,187,187);word-=
wrap:break-word;background-color:rgb(250,250,250)"><code><div><span style=
=3D"color:#008">class</span><span style=3D"color:#000"> frame_ticks =C2=A0<=
/span><span style=3D"color:#800">// or some name that better describes this=
....</span><span style=3D"color:#000"><br></span><span style=3D"color:#660">=
{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 uint64_t fstart</span>=
<span style=3D"color:#660">;</span><span style=3D"color:#000"><br>=C2=A0 =
=C2=A0 uint64_t fend</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0 uint64_t frate</span><span style=3D"color=
:#660">;</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span st=
yle=3D"color:#800">// ...</span><span style=3D"color:#000"><br></span><span=
 style=3D"color:#660">};</span></div></code></div><div><span style=3D"font-=
family:arial,sans-serif;font-size:small"><br></span></div><div><span style=
=3D"font-family:arial,sans-serif;font-size:small">Allowing the start value =
to be set or reset on starting or stopping record/playback is another featu=
re that some might need here. =C2=A0And </span><span style=3D"font-family:a=
rial,sans-serif;font-size:small">I don&#39;t recommend eliminating the rate=
 portion from this class since it could lead to trouble where people are ma=
king assumptions they shouldn&#39;t, best to have them together.</span></di=
v><div><span style=3D"font-family:arial,sans-serif;font-size:small"><br></s=
pan></div><div><span style=3D"font-family:arial,sans-serif;font-size:small"=
>Also, I would not add other data to this class since it could be re-used e=
lsewhere as is. =C2=A0Other properties of a buffer can be defined in anothe=
r class/structure, but again this is just a suggestion...</span></div><div>=
<span style=3D"font-family:arial,sans-serif;font-size:small"><br></span></d=
iv></div></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/83016a47-e902-4292-b109-652e811d17fb%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/83016a47-e902-4292-b109-652e811d17fb=
%40isocpp.org</a>.<br />

------=_Part_615_1940005619.1465533001770--

------=_Part_614_821088863.1465533001769--

.
